示例#1
0
 public function load(ObjectManager $manager)
 {
     $obj = new Task();
     $obj->setName("Exemple de tâche pour l'été");
     $obj->setNotes("Cette tâche est créée pour la data fixture. C'est seulement pour la démonstration. Désolé!");
     $obj->setCreatedAt(new \DateTime());
     $obj->setFinished(false);
     $obj->setDueDate(new \DateTime());
     $obj->addTag($this->getReference('tag:home'));
     $obj->addTag($this->getReference('tag:important'));
     $obj->setUser($this->getReference('user:toto'));
     $manager->persist($obj);
     $manager->flush();
 }