PHP Class WC_Connect_Service_Schemas_Store, woocommerce-connect-client

Exibir arquivo Open project: Automattic/woocommerce-connect-client Class Usage Examples

Protected Properties

Property Type Description
$api_client WC_Connect_API_Client
$logger WC_Connect_Logger

Public Methods

Method Description
__construct ( WC_Connect_API_Client $api_client, WC_Connect_Logger $logger )
fetch_service_schemas_from_connect_server ( )
get_all_service_ids_of_type ( string $type ) : array Returns all service ids of a specific type (e.g. shipping)
get_last_fetch_timestamp ( )
get_packages_schema ( ) : object | null Returns packages schema
get_predefined_packages_schema ( )
get_predefined_packages_schema_for_service ( $service_id )
get_service_schema_by_id ( $service_id ) : object | null Returns a particular service's schema given its id
get_service_schema_by_id_or_instance_id ( string $id_or_instance_id ) : object | null Returns a service's schema given an id or shipping zone instance.
get_service_schema_by_instance_id ( string $instance_id ) : object | null Returns a service's schema given its shipping zone instance
get_service_schemas ( )

Protected Methods

Method Description
maybe_update_heartbeat ( )
update_last_fetch_timestamp ( )
update_service_schemas ( $service_schemas )

Method Details

__construct() public method

public __construct ( WC_Connect_API_Client $api_client, WC_Connect_Logger $logger )
$api_client WC_Connect_API_Client
$logger WC_Connect_Logger

fetch_service_schemas_from_connect_server() public method

get_all_service_ids_of_type() public method

Returns all service ids of a specific type (e.g. shipping)
public get_all_service_ids_of_type ( string $type ) : array
$type string The type of services to return
return array An array of that type's service ids, or an empty array if no such type is known

get_last_fetch_timestamp() public method

get_packages_schema() public method

Returns packages schema
public get_packages_schema ( ) : object | null
return object | null Packages schema on success, null on failure

get_predefined_packages_schema() public method

get_predefined_packages_schema_for_service() public method

get_service_schema_by_id() public method

Returns a particular service's schema given its id
public get_service_schema_by_id ( $service_id ) : object | null
return object | null The service schema or null if no such id was found

get_service_schema_by_id_or_instance_id() public method

Returns a service's schema given an id or shipping zone instance.
public get_service_schema_by_id_or_instance_id ( string $id_or_instance_id ) : object | null
$id_or_instance_id string String ID or numeric instance ID.
return object | null Service schema on success, null on failure

get_service_schema_by_instance_id() public method

Returns a service's schema given its shipping zone instance
public get_service_schema_by_instance_id ( string $instance_id ) : object | null
$instance_id string The shipping zone instance id for which to return the schema
return object | null The service schema or null if no such instance was found

get_service_schemas() public method

public get_service_schemas ( )

maybe_update_heartbeat() protected method

protected maybe_update_heartbeat ( )

update_last_fetch_timestamp() protected method

update_service_schemas() protected method

protected update_service_schemas ( $service_schemas )

Property Details

$api_client protected_oe property

protected WC_Connect_API_Client $api_client
return WC_Connect_API_Client

$logger protected_oe property

protected WC_Connect_Logger $logger
return WC_Connect_Logger