Dunglas\DoctrineJsonOdm\Tests\Fixtures\TestBundle\Entity\Bar::setTitle PHP Method

setTitle() public method

public setTitle ( mixed $title )
$title mixed
    public function setTitle($title)
    {
        $this->title = $title;
    }

Usage Example

 public function testStoreAndRetrieveDocumentsOfVariousTypes()
 {
     $bar = new Bar();
     $bar->setTitle('Bar');
     $bar->setWeight(12);
     $baz = new Baz();
     $baz->setName('Baz');
     $baz->setSize(7);
     $misc = [$bar, $baz];
     $foo = new Foo();
     $foo->setName('Foo');
     $foo->setMisc($misc);
     $manager = self::$kernel->getContainer()->get('doctrine')->getManagerForClass(Foo::class);
     $manager->persist($foo);
     $manager->flush();
     $manager->clear();
     $foo = $manager->find(Foo::class, $foo->getId());
     $this->assertEquals($misc, $foo->getMisc());
 }