/** * (non-PHPdoc) * @see Doctrine\Common\DataFixtures.FixtureInterface::load() */ public function load(ObjectManager $manager) { $news = new News(); $news->setTitle('News title'); $news->setContent('News content www.google.it'); $news->getChannels()->add($this->getReference('laureati-channel')); $news->getChannels()->add($this->getReference('ingegneria-channel')); $news->setUser($this->getReference('admin-user')); $news->setDeleted(false); $manager->persist($news); $manager->flush(); }