Example #1
0
 public function load(ObjectManager $manager)
 {
     // Liste des noms de catégorie à ajouter
     $names = array('Famille', 'Administration', 'Entretien maison', 'Eau/Electricite/Gaz', 'Transports', 'Sports', 'Lieux', 'Pour manger', 'Achats', 'Foulon', 'Livre d\'or');
     foreach ($names as $name) {
         // On crée la catégorie
         $category = new Category();
         $category->setName($name);
         // On la persiste
         $manager->persist($category);
     }
     // On déclenche l\'enregistrement de toutes les catégories
     $manager->flush();
 }
 /**
  * {@inheritDoc}
  */
 public function getName()
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getName', []);
     return parent::getName();
 }