File "Response.php"

Full Path: /home/vantageo/public_html/cache/cache/cache/cache/cache/.wp-cli/wp-content/plugins/facebook-for-woocommerce/includes/API/Catalog/Product_Group/Products/Read/Response.php
File size: 905 bytes
MIME-type: text/x-php
Charset: utf-8

<?php
/**
 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
 *
 * This source code is licensed under the license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @package FacebookCommerce
 */

namespace WooCommerce\Facebook\API\Catalog\Product_Group\Products\Read;

defined( 'ABSPATH' ) || exit;

use WooCommerce\Facebook\API;

/**
 * Response object for the API endpoint that returns a list of Product Items in a particular Product Group.
 *
 * @since 2.0.0
 */
class Response extends API\Response {


	use API\Traits\Paginated_Response;


	/**
	 * Gets the Product Item IDs indexed by the retailer ID.
	 *
	 * @since 2.0.0
	 *
	 * @return array
	 */
	public function get_ids() {

		$product_item_ids = array();

		foreach ( $this->get_data() as $entry ) {
			$product_item_ids[ $entry->retailer_id ] = $entry->id;
		}

		return $product_item_ids;
	}
}