FeedInterface.php
2 weeks ago
FeedValidatorInterface.php
5 months ago
ProductLoader.php
5 months ago
ProductMapperInterface.php
5 months ago
ProductWalker.php
5 months ago
WalkerProgress.php
5 months ago
ProductLoader.php
37 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Product Loader class. |
| 4 | * |
| 5 | * @package Automattic\WooCommerce\Internal\ProductFeed |
| 6 | */ |
| 7 | |
| 8 | declare(strict_types=1); |
| 9 | |
| 10 | namespace Automattic\WooCommerce\Internal\ProductFeed\Feed; |
| 11 | |
| 12 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | exit; |
| 14 | } |
| 15 | |
| 16 | /** |
| 17 | * Loader for products. |
| 18 | * |
| 19 | * @since 10.5.0 |
| 20 | */ |
| 21 | class ProductLoader { |
| 22 | /** |
| 23 | * Retrieves products from WooCommerce. |
| 24 | * |
| 25 | * @since 10.5.0 |
| 26 | * |
| 27 | * @see wc_get_products() |
| 28 | * |
| 29 | * @param array $args The arguments to pass to wc_get_products(). |
| 30 | * @return array|\stdClass Number of pages and an array of product objects if |
| 31 | * paginate is true, or just an array of values. |
| 32 | */ |
| 33 | public function get_products( array $args ) { |
| 34 | return wc_get_products( $args ); |
| 35 | } |
| 36 | } |
| 37 |