public function load(ObjectManager $em) { $histoire = new Category(); $histoire->setName('Histoire'); $maths = new Category(); $maths->setName('Mathématique'); $francais = new Category(); $francais->setName('Français'); $physique = new Category(); $physique->setName('Physique'); $dessin = new Category(); $dessin->setName('Dessin'); $em->persist($histoire); $em->persist($maths); $em->persist($francais); $em->persist($physique); $em->persist($dessin); $em->flush(); $this->addReference('category-histoire', $histoire); $this->addReference('category-maths', $maths); $this->addReference('category-francais', $francais); $this->addReference('category-physique', $physique); $this->addReference('category-dessin', $dessin); }
/** * @VirtualProperty * @SerializedName ("category_name") * * @return string */ public function get_category_name() { return $this->category->getName(); }