Example #1
0
 /**
  * {@inheritDoc}
  */
 public function load(ObjectManager $manager)
 {
     // force id = 1
     $metadata = $manager->getClassMetaData(get_class(new OrderStatus()));
     $metadata->setIdGeneratorType(\Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_NONE);
     // created
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_CREATED);
     $this->createStatusTranslation($manager, $status, 'Created', 'en');
     $this->createStatusTranslation($manager, $status, 'Erfasst', 'de');
     $this->createStatusTranslation($manager, $status, 'Erfasst', 'de_ch');
     $manager->persist($status);
     // cart
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_IN_CART);
     $this->createStatusTranslation($manager, $status, 'In Cart', 'en');
     $this->createStatusTranslation($manager, $status, 'Im Warenkorb', 'de');
     $this->createStatusTranslation($manager, $status, 'Im Warenkorb', 'de_ch');
     $manager->persist($status);
     // confirmed
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_CONFIRMED);
     $this->createStatusTranslation($manager, $status, 'Order confirmed', 'en');
     $this->createStatusTranslation($manager, $status, 'Bestätigt', 'de');
     $this->createStatusTranslation($manager, $status, 'Bestätigt', 'de_ch');
     $manager->persist($status);
     // confirmed
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_CLOSED_MANUALLY);
     $this->createStatusTranslation($manager, $status, 'Manually closed', 'en');
     $this->createStatusTranslation($manager, $status, 'Manuell geschlossen', 'de');
     $this->createStatusTranslation($manager, $status, 'Manuell geschlossen', 'de_ch');
     $manager->persist($status);
     // canceled
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_CANCELED);
     $this->createStatusTranslation($manager, $status, 'Canceled', 'en');
     $this->createStatusTranslation($manager, $status, 'Abgebrochen', 'de');
     $this->createStatusTranslation($manager, $status, 'Abgebrochen', 'de_ch');
     $manager->persist($status);
     // canceled
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_COMPLETED);
     $this->createStatusTranslation($manager, $status, 'Completed', 'en');
     $this->createStatusTranslation($manager, $status, 'Abgeschlossen', 'de');
     $this->createStatusTranslation($manager, $status, 'Abgeschlossen', 'de_ch');
     $manager->persist($status);
     // canceled
     $status = new OrderStatus();
     $status->setId(OrderStatus::STATUS_CART_PENDING);
     $this->createStatusTranslation($manager, $status, 'Cart order pending', 'en');
     $this->createStatusTranslation($manager, $status, 'Warenkorb in Bearbeitung', 'de');
     $this->createStatusTranslation($manager, $status, 'Warenkorb in Bearbeitung', 'de_ch');
     $manager->persist($status);
     $manager->flush();
 }
Example #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;
 }