예제 #1
0
파일: TagsFixtures.php 프로젝트: dawidf/air
 /**
  * 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();
 }
예제 #2
0
 /**
  * {@inheritDoc}
  */
 public function preSave()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'preSave', array());
     return parent::preSave();
 }