woocommerce
/
src
/
Admin
/
Features
/
MarketingRecommendations
/
MarketingRecommendationsDataSourcePoller.php
DefaultMarketingRecommendations.php
3 months ago
Init.php
1 year ago
MarketingRecommendationsDataSourcePoller.php
1 year ago
MiscRecommendationsDataSourcePoller.php
1 year ago
MarketingRecommendationsDataSourcePoller.php
59 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Automattic\WooCommerce\Admin\Features\MarketingRecommendations; |
| 4 | |
| 5 | use Automattic\WooCommerce\Admin\RemoteSpecs\DataSourcePoller; |
| 6 | use WC_Helper; |
| 7 | |
| 8 | /** |
| 9 | * Specs data source poller class for marketing recommendations. |
| 10 | */ |
| 11 | class MarketingRecommendationsDataSourcePoller extends DataSourcePoller { |
| 12 | |
| 13 | /** |
| 14 | * Data Source Poller ID. |
| 15 | */ |
| 16 | const ID = 'marketing_recommendations'; |
| 17 | |
| 18 | /** |
| 19 | * Default data sources array. |
| 20 | * |
| 21 | * @deprecated since 9.5.0. Use get_data_sources() instead. |
| 22 | */ |
| 23 | const DATA_SOURCES = array(); |
| 24 | |
| 25 | /** |
| 26 | * Class instance. |
| 27 | * |
| 28 | * @var MarketingRecommendationsDataSourcePoller instance |
| 29 | */ |
| 30 | protected static $instance = null; |
| 31 | |
| 32 | /** |
| 33 | * Get class instance. |
| 34 | */ |
| 35 | public static function get_instance() { |
| 36 | if ( ! self::$instance ) { |
| 37 | self::$instance = new self( |
| 38 | self::ID, |
| 39 | self::get_data_sources(), |
| 40 | array( |
| 41 | 'spec_key' => 'product', |
| 42 | ) |
| 43 | ); |
| 44 | } |
| 45 | return self::$instance; |
| 46 | } |
| 47 | |
| 48 | /** |
| 49 | * Get data sources. |
| 50 | * |
| 51 | * @return array |
| 52 | */ |
| 53 | public static function get_data_sources() { |
| 54 | return array( |
| 55 | WC_Helper::get_woocommerce_com_base_url() . 'wp-json/wccom/marketing-tab/1.3/recommendations.json', |
| 56 | ); |
| 57 | } |
| 58 | } |
| 59 |