Beispiel #1
0
 /**
  * @param ItemInterface $item
  * @param array $itemData
  * @param string $locale
  * @param int $userId
  * @param OrderEntity $order
  * @param ItemInterface|null $lastProcessedProductItem
  *
  * @return null|Item
  */
 public function updateItem(ItemInterface $item, $itemData, $locale, $userId, OrderEntity $order, ItemInterface $lastProcessedProductItem = null)
 {
     return $this->itemManager->save($itemData, $locale, $userId, $item, null, $order->getCustomerContact(), $lastProcessedProductItem);
 }
Beispiel #2
0
 /**
  * Creates a test order.
  *
  * @return Order
  */
 public function createNewTestOrder()
 {
     // Order
     $order = new Order();
     $order->setNumber('1234');
     $order->setCommission('commission');
     $order->setCostCentre('cost-centre');
     $order->setCustomerName($this->contact->getFullName());
     $order->setCurrencyCode($this->defaultCurrencyCode);
     $order->setTermsOfDelivery($this->termsOfDelivery);
     $order->setTermsOfDeliveryContent($this->termsOfDelivery->getTerms());
     $order->setTermsOfPayment($this->termsOfPayment);
     $order->setTermsOfPaymentContent($this->termsOfPayment->getTerms());
     $order->setCreated(new \DateTime());
     $order->setChanged(new \DateTime());
     $order->setCreator();
     $order->setDesiredDeliveryDate(new \DateTime('2015-01-01'));
     $order->setSessionId('abcd1234');
     $order->setTaxfree(true);
     $order->setCustomerContact($this->contact);
     $order->setCustomerAccount($this->account);
     $order->setStatus($this->orderStatus);
     $order->setBitmaskStatus($this->orderStatus->getId());
     $order->setDeliveryAddress($this->orderAddressDelivery);
     $order->setInvoiceAddress($this->orderAddressInvoice);
     $order->setCreator($this->user);
     $order->setChanger($this->user);
     $order->setResponsibleContact($this->contact2);
     $order->setInternalNote('tiny internal note');
     $this->em->persist($order);
     return $order;
 }