Exemplo n.º 1
0
 public function load(ObjectManager $manager)
 {
     //dump($this->getReference('refcat'));
     //die;
     $product = new Product();
     $product->setTitle('mon super produit fixtures');
     $product->setDescription('lorem ipsum');
     $product->setPrix('250 Euros');
     $product->setQuantite('20');
     $product->setActive('true');
     $product->setCateg($this->getReference('refcat'));
     $product->setProduitMarque($this->getReference('refbrand'));
     $manager->persist($product);
     $manager->flush();
 }
Exemplo n.º 2
0
 /**
  * Add products
  *
  * @param \Troiswa\BackBundle\Entity\Product $products
  * @return Category
  */
 public function addProduct(\Troiswa\BackBundle\Entity\Product $products)
 {
     $this->products[] = $products;
     //dump($products);
     // die();
     $products->setCateg($this);
     return $this;
 }