/** * {@inheritdoc} */ public function load(ObjectManager $manager) { $post = new Post(); $post->setTitle('Cras dignissim vestibulum ultrices'); $post->setSummary($this->getPostSummary()); $post->setContent($this->getPostContent()); $post->setAuthor($this->getReference('user-john_admin')); $post->setCategory($this->getReference('category-Vestibulum')); $post->addTag($this->getReference('tag-volutpat')); $post->addTag($this->getReference('tag-enim')); $post->addTag($this->getReference('tag-bibendum')); $manager->persist($post); $this->setReference('post-1', $post); $post = new Post(); $post->setTitle('Neque porro quisquam est qui dolorem'); $post->setSummary($this->getPostSummary()); $post->setContent($this->getPostContent()); $post->setAuthor($this->getReference('user-john_admin')); $post->setCategory($this->getReference('category-Dolorem')); $post->addTag($this->getReference('tag-uspendisse')); $post->addTag($this->getReference('tag-imperdiet')); $post->addTag($this->getReference('tag-ullamcorper')); $manager->persist($post); $this->setReference('post-2', $post); $post = new Post(); $post->setTitle('Ut enim ad minim veniam, quis nostrud'); $post->setSummary($this->getPostSummary()); $post->setContent($this->getPostContent()); $post->setAuthor($this->getReference('user-john_admin')); $post->setCategory($this->getReference('category-Nostrud')); $post->addTag($this->getReference('tag-lacus')); $post->addTag($this->getReference('tag-aliquam')); $post->addTag($this->getReference('tag-eumassa')); $manager->persist($post); $this->setReference('post-3', $post); $post = new Post(); $post->setTitle('Duis aute irure dolor in reprehenderit'); $post->setSummary($this->getPostSummary()); $post->setContent($this->getPostContent()); $post->setAuthor($this->getReference('user-john_admin')); $post->setCategory($this->getReference('category-Reprehenderit')); $post->addTag($this->getReference('tag-utnunc')); $post->addTag($this->getReference('tag-gravida')); $post->addTag($this->getReference('tag-ullamcorper')); $manager->persist($post); $this->setReference('post-4', $post); $post = new Post(); $post->setTitle('Excepteur sint occaecat cupidatat proident'); $post->setSummary($this->getPostSummary()); $post->setContent($this->getPostContent()); $post->setAuthor($this->getReference('user-john_admin')); $post->setCategory($this->getReference('category-Dolorem')); $post->addTag($this->getReference('tag-uspendisse')); $post->addTag($this->getReference('tag-maecenas')); $post->addTag($this->getReference('tag-justo')); $manager->persist($post); $this->setReference('post-5', $post); $post = new Post(); $post->setTitle('Aenean eget lobortis lectus'); $post->setSummary($this->getPostSummary()); $post->setContent($this->getPostContent()); $post->setAuthor($this->getReference('user-john_admin')); $post->setCategory($this->getReference('category-Dolorem')); $post->addTag($this->getReference('tag-consectetur')); $post->addTag($this->getReference('tag-imperdiet')); $post->addTag($this->getReference('tag-facilisis')); $manager->persist($post); $this->setReference('post-6', $post); $manager->flush(); }
/** * {@inheritDoc} */ public function addTag(\AppBundle\Entity\Tag $tag) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'addTag', [$tag]); return parent::addTag($tag); }