modules/acm/src/Connector/IngestAPIWrapper.php
public function productFullSync($skus = '', $product_page_size = 0, $store_id = "", $langcode = "", $categoryId = "") {
    if (empty($product_page_size)) {
      $product_page_size = (int) $this->productPageSize;
    }
    else {
      $product_page_size = (int) $product_page_size;
    }

    if (!($store_id && $langcode)) {
      $languageMap = $this->i18nHelper->getStoreLanguageMapping();
    }
    else {
      $languageMap = [$langcode => $store_id];
    }

    foreach ($languageMap as $langcode => $store_id) {
      if (empty($store_id)) {
        continue;
      }

      // At 20180228 store_id *is* acm_uuid is enforced
      // $store_id is sent in the query string
      // $acm_uuid is sent in the X-ACM-UUID header
      // It must only be this way:
      $acm_uuid = $store_id;

      if ($this->debug && !empty($this->debugDir)) {
        // Export product data into file.
        $filename = $this->debugDir . '/products_' . $langcode . '.data';
        $fp = fopen($filename, 'w');
        fclose($fp);
      }

      $endpoint = $this->apiVersion . '/ingest/product/sync';

      // $store_id is sent in the query string.
      $doReq = function ($client, $opt) use ($endpoint, $store_id, $skus, $product_page_size, $categoryId) {
        if ($product_page_size > 0) {
          $opt['query']['page_size'] = $product_page_size;
        }

        if (!empty($categoryId)) {
          $opt['query']['category_id'] = (string) $categoryId;

          // Function tryIngestRequest always sets the skus.
          // But in this case (category sync) we force no skus
          // always send all the skus in the category.
          unset($opt['query']['skus']);
        }
        elseif (!empty($skus)) {
          $opt['query']['skus'] = $skus;
        }

        $opt['query']['store_id'] = $store_id;

        // To allow hmac sign to be verified properly we need them in asc order.
        // Really?
        ksort($opt['query']);

        return $client->post($endpoint, $opt);
      };

      try {
        // $acm_uuid is set in the header of the client.
        $this->tryIngestRequest($doReq, 'productFullSync', 'products', $skus, $acm_uuid);
      }
      catch (ConnectorException $e) {
        throw new RouteException(__FUNCTION__, $e->getMessage(), $e->getCode());
      }
    }
  }
public function productFullSync($skus = '', $product_page_size = 0, $store_id = "", $langcode = "", $categoryId = "") {
    if (empty($product_page_size)) {
      $product_page_size = (int) $this->productPageSize;
    }
    else {
      $product_page_size = (int) $product_page_size;
    }

    if (!($store_id && $langcode)) {
      $languageMap = $this->i18nHelper->getStoreLanguageMapping();
    }
    else {
      $languageMap = [$langcode => $store_id];
    }

    foreach ($languageMap as $langcode => $store_id) {
      if (empty($store_id)) {
        continue;
      }

      // At 20180228 store_id *is* acm_uuid is enforced
      // $store_id is sent in the query string
      // $acm_uuid is sent in the X-ACM-UUID header
      // It must only be this way:
      $acm_uuid = $store_id;

      if ($this->debug && !empty($this->debugDir)) {
        // Export product data into file.
        $filename = $this->debugDir . '/products_' . $langcode . '.data';
        $fp = fopen($filename, 'w');
        fclose($fp);
      }

      $endpoint = $this->apiVersion . '/ingest/product/sync';

      // $store_id is sent in the query string.
      $doReq = function ($client, $opt) use ($endpoint, $store_id, $skus, $product_page_size, $categoryId) {
        if ($product_page_size > 0) {
          $opt['query']['page_size'] = $product_page_size;
        }

        if (!empty($categoryId)) {
          $opt['query']['category_id'] = (string) $categoryId;

          // Function tryIngestRequest always sets the skus.
          // But in this case (category sync) we force no skus
          // always send all the skus in the category.
          unset($opt['query']['skus']);
        }
        elseif (!empty($skus)) {
          $opt['query']['skus'] = $skus;
        }

        $opt['query']['store_id'] = $store_id;

        // To allow hmac sign to be verified properly we need them in asc order.
        // Really?
        ksort($opt['query']);

        return $client->post($endpoint, $opt);
      };

      try {
        // $acm_uuid is set in the header of the client.
        $this->tryIngestRequest($doReq, 'productFullSync', 'products', $skus, $acm_uuid);
      }
      catch (ConnectorException $e) {
        throw new RouteException(__FUNCTION__, $e->getMessage(), $e->getCode());
      }
    }
  }
public function productFullSync ( $ skus = '' , $ product_page_size = 0 , $ store_id = "" , $ langcode = "" , $ categoryId = "" ) { if ( empty ( $ product_page_size ) ) { $ product_page_size = ( int ) $ this -> productPageSize ; } else { $ product_page_size = ( int ) $ product_page_size ; } if ( ! ( $ store_id && $ langcode ) ) { $ languageMap = $ this -> i18nHelper -> getStoreLanguageMapping ( ) ; } else { $ languageMap = [ $ langcode => $ store_id ] ; } foreach ( $ languageMap as $ langcode => $ store_id ) { if ( empty ( $ store_id ) ) { continue ; } // At 20180228 store_id *is* acm_uuid is enforced // $store_id is sent in the query string // $acm_uuid is sent in the X-ACM-UUID header // It must only be this way: $ acm_uuid = $ store_id ; if ( $ this -> debug && ! empty ( $ this -> debugDir ) ) { // Export product data into file. $ filename = $ this -> debugDir . '/products_' . $ langcode . '.data' ; $ fp = fopen ( $ filename , 'w' ) ; fclose ( $ fp ) ; } $ endpoint = $ this -> apiVersion . '/ingest/product/sync' ; // $store_id is sent in the query string. $ doReq = function ( $ client , $ opt ) use ( $ endpoint , $ store_id , $ skus , $ product_page_size , $ categoryId ) { if ( $ product_page_size > 0 ) { $ opt [ 'query' ] [ 'page_size' ] = $ product_page_size ; } if ( ! empty ( $ categoryId ) ) { $ opt [ 'query' ] [ 'category_id' ] = ( string ) $ categoryId ; // Function tryIngestRequest always sets the skus. // But in this case (category sync) we force no skus // always send all the skus in the category. unset ( $ opt [ 'query' ] [ 'skus' ] ) ; } elseif ( ! empty ( $ skus ) ) { $ opt [ 'query' ] [ 'skus' ] = $ skus ; } $ opt [ 'query' ] [ 'store_id' ] = $ store_id ; // To allow hmac sign to be verified properly we need them in asc order. // Really? ksort ( $ opt [ 'query' ] ) ; return $ client -> post ( $ endpoint , $ opt ) ; } ; try { // $acm_uuid is set in the header of the client. $ this -> tryIngestRequest ( $ doReq , 'productFullSync' , 'products' , $ skus , $ acm_uuid ) ; } catch ( ConnectorException $ e ) { throw new RouteException ( __FUNCTION__ , $ e -> getMessage ( ) , $ e -> getCode ( ) ) ; } } }
Performs full connector sync.

@param string $skus
List of SKUs.
@param int $product_page_size
Override for product page size.
@param string $store_id
Optional store_id if specified you must specify a langcode.
@param string $langcode
Optional laguage code. If specified you must specify a $storeId.
@param string $categoryId
Optional. The category ID to sync from. If specified, skus are ignored
and all skus of that category are synchronised.
Performs full connector sync .