Exemplo n.º 1
0
 public function load(ObjectManager $em)
 {
     $no_category = new Category();
     $no_category->setName('No category');
     $no_category->setDescription('Desktops No category');
     $no_category->setImage('no-category.jpg');
     $no_category->setIsActive(1);
     $blog = new Category();
     $blog->setName('Blog');
     $blog->setDescription('Blog Description');
     $blog->setImage('blog.jpg');
     $blog->setIsActive(1);
     $shop = new Category();
     $shop->setName('Shop');
     $shop->setDescription('Shop Description');
     $shop->setImage('shop.jpg');
     $shop->setIsActive(1);
     $em->persist($no_category);
     $em->persist($blog);
     $em->persist($shop);
     $em->flush();
     $this->addReference('category-no_category', $no_category);
     $this->addReference('category-blog', $blog);
     $this->addReference('category-shop', $shop);
 }
Exemplo n.º 2
0
 public function load(ObjectManager $em)
 {
     $forum = new Category();
     $forum->setName('Forum tutorial');
     $forum->setDescription('Forum Description');
     $forum->setImage('forum.jpg');
     $forum->setIsActive(1);
     $blog = new Category();
     $blog->setName('Blog tutorial');
     $blog->setDescription('Blog Description');
     $blog->setImage('blog.jpg');
     $blog->setIsActive(1);
     $shop = new Category();
     $shop->setName('Shop tutorial');
     $shop->setDescription('Shop Description');
     $shop->setImage('shop.jpg');
     $shop->setIsActive(1);
     $em->persist($forum);
     $em->persist($blog);
     $em->persist($shop);
     $em->flush();
     $this->addReference('category-forum', $forum);
     $this->addReference('category-blog', $blog);
     $this->addReference('category-shop', $shop);
 }