Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity($id)
 {
     $result = $this->transport->call(SoapTransport::ACTION_ORDER_INFO, ['orderIncrementId' => $id->increment_id]);
     $result->items = $this->processCollectionResponse($result->items);
     $this->addDependencyData($result);
     return ConverterUtils::objectToArray($result);
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity($id)
 {
     if (!array_key_exists($id, $this->entityBuffer)) {
         $this->logger->warning(sprintf('Entity with id "%s" was not found', $id));
         return false;
     }
     $result = $this->entityBuffer[$id];
     return ConverterUtils::objectToArray($result);
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity($id)
 {
     $result = $this->transport->call(SoapTransport::ACTION_CUSTOMER_INFO, ['customerId' => $id]);
     $result->addresses = $this->getCustomerAddressData($id);
     foreach ($result->addresses as $key => $val) {
         $result->addresses[$key] = (array) $val;
     }
     /**
      * @TODO move to converter
      */
     // fill related entities data, needed to create full representation of magento store state in this time
     // flat array structure will be converted by data converter
     $result->group = $this->dependencies[self::ALIAS_GROUPS][$result->group_id];
     $result->group['originId'] = $result->group['customer_group_id'];
     $result->store = $this->dependencies[self::ALIAS_STORES][$result->store_id];
     $result->store['originId'] = $result->store_id;
     $result->website = $this->dependencies[self::ALIAS_WEBSITES][$result->website_id];
     $result->website['originId'] = $result->website['id'];
     return ConverterUtils::objectToArray($result);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 protected function getData()
 {
     $websites = [];
     if ($this->transport->isSupportedExtensionVersion()) {
         $websites = $this->transport->call(SoapTransport::ACTION_ORO_WEBSITE_LIST);
         $websites = ConverterUtils::objectToArray($websites);
     } else {
         $stores = $this->transport->getStores();
         foreach ($stores as $store) {
             $websites[$store['website_id']]['name'][] = $store['name'];
             $websites[$store['website_id']]['code'][] = $store['code'];
         }
         foreach ($websites as $websiteId => $websiteItem) {
             $websites[$websiteId]['name'] = implode(SoapTransport::WEBSITE_NAME_SEPARATOR, $websiteItem['name']);
             $websites[$websiteId]['code'] = implode(SoapTransport::WEBSITE_CODE_SEPARATOR, $websiteItem['code']);
             $websites[$websiteId]['website_id'] = $websiteId;
         }
     }
     return $websites;
 }
Ejemplo n.º 5
0
 /**
  * {@inheritdoc}
  */
 protected function getEntity($id)
 {
     $result = $this->entityBuffer[$id];
     $this->addDependencyData($result);
     return ConverterUtils::objectToArray($result);
 }
Ejemplo n.º 6
0
 /**
  * {@inheritdoc}
  */
 public function updateNewsletterSubscriber($subscriberId, array $subscriberData)
 {
     if ($this->isExtensionInstalled()) {
         $result = $this->call(SoapTransport::ACTION_ORO_NEWSLETTER_SUBSCRIBER_UPDATE, ['subscriberId' => $subscriberId, 'subscriberData' => $subscriberData]);
         return ConverterUtils::objectToArray($result);
     }
     throw new ExtensionRequiredException();
 }
 /**
  * @param array $filters
  * @return array|null
  */
 protected function getNewsletterSubscribers(array $filters = [])
 {
     $result = $this->transport->call(SoapTransport::ACTION_ORO_NEWSLETTER_SUBSCRIBER_LIST, $filters);
     return ConverterUtils::objectToArray($result);
 }
Ejemplo n.º 8
0
 /**
  * {@inheritdoc}
  */
 protected function loadEntityInfo($originId)
 {
     $this->logger->info(sprintf('Loading Order info by incrementId: %s', $originId));
     $result = $this->transport->getOrderInfo($originId);
     return ConverterUtils::objectToArray($result);
 }