/** * {@inheritDoc} */ public function load(ObjectManager $manager) { $category = new Category(); $category->setName('First Category'); $manager->persist($category); $manager->flush(); $this->addReference('first-category', $category); $category = new Category(); $category->setName('Second Category'); $manager->persist($category); $manager->flush(); }
/** * Get category id * * @return integer */ public function getCategoryId() { if ($this->category) { return $this->category->getId(); } return null; }