Пример #1
0
 /**
  * @return CartItem
  */
 protected function createCartItem()
 {
     $cartItem = new CartItem();
     $cartItem->setName('item' . mt_rand(0, 99999));
     $cartItem->setDescription('something');
     $cartItem->setPrice(mt_rand(10, 99999));
     $cartItem->setProductId(1);
     $cartItem->setFreeShipping('true');
     $cartItem->setIsVirtual(1);
     $cartItem->setRowTotal(100);
     $cartItem->setTaxAmount(10);
     $cartItem->setProductType('type');
     $cartItem->setSku('sku');
     $cartItem->setQty(0);
     $cartItem->setDiscountAmount(0);
     $cartItem->setTaxPercent(0);
     $cartItem->setCreatedAt(new \DateTime('now'));
     $cartItem->setUpdatedAt(new \DateTime('now'));
     $this->em->persist($cartItem);
     return $cartItem;
 }