Automattic\WooCommerce\Admin

DataSourcePoller{}abstractWC 1.0└─ RemoteSpecsDataSourcePoller

Deprecated since since 8.8.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.

Specs data source poller class. This handles polling specs from JSON endpoints, and stores the specs in to the database as an option.

No Hooks.

Usage

$DataSourcePoller = new DataSourcePoller();
// use class methods

Methods

  1. public __construct( $id, $data_sources = array(), $args = array() )
  2. ERROR: no method name found on line `*`
  3. public delete_specs_transient()
  4. ERROR: no method name found on line ``
  5. ERROR: no method name found on line ``
  6. ERROR: no method name found on line `/**`
  7. public set_specs_transient( $specs, $expiration = 0 )
  8. ERROR: no method name found on line ``
  9. public get_specs_from_data_sources()
  10. ERROR: no method name found on line ``
  11. private static log_deprecation()
  12. ERROR: no method name found on line ``
  13. ERROR: no method name found on line ``
  14. public read_specs_from_data_sources()
  15. ERROR: no method name found on line ``
  16. ERROR: no method name found on line ``
  17. ERROR: no method name found on line ``

Changelog

Deprecated Since 8.8. 0

DataSourcePoller{} code WC 9.9.3

abstract class DataSourcePoller extends RemoteSpecsDataSourcePoller {
	/**
	 * Log a deprecation to the error log.
	 */
	private static function log_deprecation() {
		/**
		 * Note: Deprecation messages have been temporarily disabled due to upgrade issues.
		 * For more details, see the discussion in the WooCommerce GitHub repository:
		 * https://github.com/woocommerce/woocommerce/pull/45892.
		 */
	}

	/**
	 * Constructor.
	 *
	 * @param string $id id of DataSourcePoller.
	 * @param array  $data_sources urls for data sources.
	 * @param array  $args Options for DataSourcePoller.
	 */
	public function __construct( $id, $data_sources = array(), $args = array() ) {
		self::log_deprecation();
		parent::__construct( $id, $data_sources, $args );
	}

	/**
	 * Reads the data sources for specs and persists those specs.
	 *
	 * @deprecated 8.8.0
	 * @return array list of specs.
	 */
	public function get_specs_from_data_sources() {
		self::log_deprecation();
		return parent::get_specs_from_data_sources();
	}

	/**
	 * Reads the data sources for specs and persists those specs.
	 *
	 * @deprecated 8.8.0
	 * @return bool Whether any specs were read.
	 */
	public function read_specs_from_data_sources() {
		self::log_deprecation();
		return parent::read_specs_from_data_sources();
	}

	/**
	 * Delete the specs transient.
	 *
	 * @deprecated 8.8.0
	 * @return bool success of failure of transient deletion.
	 */
	public function delete_specs_transient() {
		self::log_deprecation();
		return parent::delete_specs_transient();
	}

	/**
	 * Set the specs transient.
	 *
	 * @param array $specs The specs to set in the transient.
	 * @param int   $expiration The expiration time for the transient.
	 *
	 * @deprecated 8.8.0
	 */
	public function set_specs_transient( $specs, $expiration = 0 ) {
		self::log_deprecation();
		return parent::set_specs_transient( $specs, $expiration );
	}
}