コード例 #1
0
 public function load(ObjectManager $manager)
 {
     $categorie1 = new Categories();
     $categorie1->setNom('Stylos');
     $categorie1->setImage($this->getReference('media'));
     $manager->persist($categorie1);
     $categorie2 = new Categories();
     $categorie2->setNom('Cahiers');
     $categorie2->setImage($this->getReference('media7'));
     $manager->persist($categorie2);
     $manager->flush();
     $this->addReference('categorie1', $categorie1);
     $this->addReference('categorie2', $categorie2);
 }
 /**
  * {@inheritDoc}
  */
 public function setNom($nom)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setNom', array($nom));
     return parent::setNom($nom);
 }