WC_Connect_Service_Settings_Store::get_service_failure_timestamp_key PHP Method

get_service_failure_timestamp_key() public method

Based on the service id and optional instance, generates the options key that should be used to get/set the service's last failure timestamp
public get_service_failure_timestamp_key ( string $service_id, integer $service_instance = false ) : string
$service_id string
$service_instance integer
return string
        public function get_service_failure_timestamp_key($service_id, $service_instance = false)
        {
            if (!$service_instance) {
                return 'woocommerce_' . $service_id . '_failure_timestamp';
            }
            return 'woocommerce_' . $service_id . '_' . $service_instance . '_failure_timestamp';
        }

Usage Example

 public function set_last_request_failed($timestamp = null)
 {
     if (is_null($timestamp)) {
         $timestamp = time();
     }
     update_option($this->service_settings_store->get_service_failure_timestamp_key($this->id, $this->instance_id), $timestamp);
 }
All Usage Examples Of WC_Connect_Service_Settings_Store::get_service_failure_timestamp_key