public function load(ObjectManager $em)
 {
     for ($i = 0; $i <= $this->getOrder(); $i++) {
         $product = new Product();
         $product->setName("product-" . rand(1000000, 9999999) . '-' . time());
         $product->setQuantity($i + 1);
         $product->setPrice(rand(10000, 99999) / 100);
         $em->persist($product);
     }
     $em->flush();
 }
Exemple #2
0
 public function getProductName()
 {
     return $this->product->getName();
 }