Пример #1
0
 /**
  * Process search for removal carts in CRM and mark them as "expired"
  *
  * @param array $ids
  */
 protected function processBatch($ids)
 {
     $filterBag = new BatchFilterBag();
     $filterBag->addStoreFilter($this->stores);
     $filterBag->addComplexFilter('entity_id', ['key' => 'entity_id', 'value' => ['key' => 'in', 'value' => implode(',', array_keys($ids))]]);
     $filters = $filterBag->getAppliedFilters();
     $filters['pager'] = ['page' => 1, 'pageSize' => $this->batchSize];
     $result = $this->transport->call(SoapTransport::ACTION_ORO_CART_LIST, $filters);
     $result = WSIUtils::processCollectionResponse($result);
     $resultIds = array_map(function (&$item) {
         return (int) $item->entity_id;
     }, $result);
     $resultIds = array_flip($resultIds);
     $removedIds = array_values(array_diff_key($ids, $resultIds));
     $this->em->getRepository('OroCRMMagentoBundle:Cart')->markExpired($removedIds);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function getCustomerAddresses($originId)
 {
     if ($this->isSupportedExtensionVersion()) {
         $endpoint = SoapTransport::ACTION_ORO_CUSTOMER_ADDRESS_LIST;
     } else {
         $endpoint = SoapTransport::ACTION_CUSTOMER_ADDRESS_LIST;
     }
     $addresses = $this->call($endpoint, ['customerId' => $originId]);
     $addresses = WSIUtils::processCollectionResponse($addresses);
     return ConverterUtils::objectToArray($addresses);
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function getCustomerAddresses(Customer $customer)
 {
     $customerId = $customer->getOriginId();
     $addresses = $this->call(SoapTransport::ACTION_CUSTOMER_ADDRESS_LIST, ['customerId' => $customerId]);
     $addresses = WSIUtils::processCollectionResponse($addresses);
     return $addresses;
 }
 /**
  * Do modifications with response for collection requests
  * Fix issues related to specific results in WSI mode
  *
  * @param mixed $response
  *
  * @return array
  */
 protected function processCollectionResponse($response)
 {
     return WSIUtils::processCollectionResponse($response);
 }
Пример #5
0
 /**
  * @param array $response
  * @return array
  */
 protected function convertResponseToMultiArray($response)
 {
     return WSIUtils::convertResponseToMultiArray($response);
 }