/** * Load data fixtures with the passed EntityManager * * @param Doctrine\Common\Persistence\ObjectManager $manager */ function load(ObjectManager $manager) { $tagList = array('oso', 'dolor', 'suspendise', 'luctus', 'faucibus', 'loctus', 'gownus', 'zasrancus'); foreach ($tagList as $key => $name) { $Tag = new Tag(); $Tag->setTitle($name); $manager->persist($Tag); //udostępnia referencja, uzyta w PostsFixtures.php $this->addReference('tag_' . $name, $Tag); } $manager->flush(); }
/** * {@inheritDoc} */ public function setTitle($title) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setTitle', array($title)); return parent::setTitle($title); }