PluginProbe
WooCommerce / 11.1.0-beta.2
WooCommerce v11.1.0-beta.2
11.1.0 11.1.0-rc.2 11.1.0-rc.1 11.1.0-beta.2 11.1.0-beta.1 11.0.1 11.0.0 11.0.0-rc.3 11.0.0-rc.2 11.0.0-rc.1 11.0.0-beta.2 11.0.0-beta.1 10.9.4 10.9.3 10.9.2 10.9.1 10.9.0 10.9.0-rc.1 10.9.0-beta.2 10.9.0-beta.1 10.8.1 10.8.0 10.8.0-rc.1 10.8.0-beta.2 10.8.0-beta.1 All 648 releases
woocommerce / src / Internal / ProductFeed / Mapping / ProductShapeMapperInterface.php
ProductShapeMapperInterface.php
36 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Product Shape Mapper Interface.
4 *
5 * @package Automattic\WooCommerce\Internal\ProductFeed
6 */
7
8 declare(strict_types=1);
9
10 namespace Automattic\WooCommerce\Internal\ProductFeed\Mapping;
11
12 /**
13 * Minimal contract for mapping a WooCommerce product to an arbitrary array shape.
14 *
15 * This interface carries no delivery semantics: implementations may produce feed
16 * rows, REST payloads, live query results, or any other shape. It can be consumed
17 * by push-feed integrations (via the ProductWalker / FeedInterface machinery) and
18 * by pull/live-query integrations alike, without taking a dependency on file or
19 * CSV delivery.
20 *
21 * This interface supersedes the Feed namespace's ProductMapperInterface, which
22 * extends it and is deprecated: all integrations, push-feed ones included, should
23 * implement this interface directly.
24 *
25 * @since 11.0.0
26 */
27 interface ProductShapeMapperInterface {
28 /**
29 * Map a product to an array shape.
30 *
31 * @param \WC_Product $product The product to map.
32 * @return array The mapped product data.
33 */
34 public function map_product( \WC_Product $product ): array;
35 }
36