/**
  * @return mixed
  * @throws \Exception
  */
 public function setDataToObject()
 {
     if (!$this->isExistOrderEntityObject($this->data['orderOuterId'])) {
         throw new \Exception('Missing orderOuterId!');
     }
     if (!$this->isExistProductEntityObject($this->data['productOuterId'])) {
         throw new \Exception('Missing productOuterId!');
     }
     /** @var Order $order */
     $order = $this->getObjectFromOrderEntityCollectionByOuterId($this->data['orderOuterId']);
     /** @var Product $product */
     $product = $this->getObjectFromProductEntityCollectionByOuterId($this->data['productOuterId']);
     $this->object->setOrderOuterId($this->getFormattedData('orderOuterId', 'string'));
     $this->object->setProductOuterId($this->getFormattedData('productOuterId', 'string'));
     $this->object->setQuantity($this->getFormattedData('quantity', 'integer'));
     $this->object->setTotal($this->getFormattedData('total', 'integer'));
     $this->object->setOrderDate($this->getFormattedData('orderDate', 'date'));
     $this->object->setOrder($order);
     $this->object->setProduct($product);
     $order->addOrderProduct($this->object);
     $product->addProductOrder($this->object);
     $this->entityManager->persist($order);
     $this->entityManager->persist($product);
     parent::setDataToObject();
 }
 /**
  * @return Order
  */
 public function setDataToObject()
 {
     $this->object->setCustomerOuterId($this->getFormattedData('customerOuterId', 'integer'));
     $this->object->setShippingMethod($this->getFormattedData('shippingMethod', 'string'));
     $this->object->setPaymentMethod($this->getFormattedData('paymentMethod', 'string'));
     $this->object->setCurrency($this->getFormattedData('currency', 'string'));
     $this->object->setOrderDate($this->getFormattedData('orderDate', 'date'));
     parent::setDataToObject();
 }
 /**
  * @return Customer
  */
 public function setDataToObject()
 {
     $this->object->setLastname($this->getFormattedData('lastname', 'string'));
     $this->object->setFirstname($this->getFormattedData('firstname', 'string'));
     $this->object->setEmail($this->getFormattedData('email', 'string'));
     $this->object->setCustomerGroup($this->getFormattedData('customerGroup', 'string'));
     $this->object->setCompany($this->getFormattedData('company', 'string'));
     $this->object->setCity($this->getFormattedData('city', 'string'));
     $this->object->setCountry($this->getFormattedData('country', 'string'));
     $this->object->setRegistrationDate($this->getFormattedData('registrationDate', 'date'));
     parent::setDataToObject();
 }
 /**
  * @return Product
  */
 public function setDataToObject()
 {
     $this->object->setSku($this->getFormattedData('sku', 'string'));
     $this->object->setName($this->getFormattedData('name', 'string'));
     $this->object->setPicture($this->getFormattedData('picture', 'string'));
     $this->object->setUrl($this->getFormattedData('url', 'string'));
     $this->object->setManufacturer($this->getFormattedData('manufacturer', 'string'));
     $this->object->setCategory($this->getFormattedData('category', 'string'));
     $this->object->setCategoryOuterId($this->getFormattedData('categoryOuterId', 'string'));
     $this->object->setIsDescription($this->getFormattedData('isDescription', 'integer'));
     $this->object->setStatus($this->getFormattedData('status', 'integer'));
     $this->object->setAvailableDate($this->getFormattedData('availableDate', 'date'));
     $this->object->setProductCreateDate($this->getFormattedData('productCreateDate', 'date'));
     parent::setDataToObject();
 }