WC_Webhook_Data_Store
in package
implements
WC_Webhook_Data_Store_Interface
Webhook data store class.
Interfaces, Classes and Traits
- WC_Webhook_Data_Store_Interface
- WooCommerce Webhook data store interface.
Table of Contents
- create() : mixed
- Create a new webhook in the database.
- delete() : mixed
- Remove a webhook from the database.
- get_api_version_number() : int
- Get API version number.
- get_count_webhooks_by_status() : array<string|int, mixed>
- Get total webhook counts by status.
- get_webhooks_ids() : array<string|int, int>
- Get webhooks IDs from the database.
- read() : mixed
- Read a webhook from the database.
- search_webhooks() : array<string|int, mixed>|object
- Search webhooks.
- update() : mixed
- Update a webhook.
- get_webhook_count() : int
- Count webhooks.
- delete_transients() : mixed
- Delete the transients used to cache a set of webhook IDs, optionally filtered by status.
- get_transient_key() : string
- Get the transient key used to cache a set of webhook IDs, optionally filtered by status.
- validate_status() : mixed
- Check if a given string is in known statuses, based on return value of @see wc_get_webhook_statuses().
Methods
create()
Create a new webhook in the database.
public
create(WC_Webhook &$webhook) : mixed
Parameters
- $webhook : WC_Webhook
-
Webhook instance.
Tags
Return values
mixed —delete()
Remove a webhook from the database.
public
delete(WC_Webhook &$webhook) : mixed
Parameters
- $webhook : WC_Webhook
-
Webhook instance.
Tags
Return values
mixed —get_api_version_number()
Get API version number.
public
get_api_version_number(string $api_version) : int
Parameters
- $api_version : string
-
REST API version.
Tags
Return values
int —get_count_webhooks_by_status()
Get total webhook counts by status.
public
get_count_webhooks_by_status() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_webhooks_ids()
Get webhooks IDs from the database.
public
get_webhooks_ids([string $status = '' ]) : array<string|int, int>
Parameters
- $status : string = ''
-
Optional - status to filter results by. Must be a key in return value of @see wc_get_webhook_statuses(). @since 3.6.0.
Tags
Return values
array<string|int, int> —read()
Read a webhook from the database.
public
read(WC_Webhook &$webhook) : mixed
Parameters
- $webhook : WC_Webhook
-
Webhook instance.
Tags
Return values
mixed —search_webhooks()
Search webhooks.
public
search_webhooks(array<string|int, mixed> $args) : array<string|int, mixed>|object
Parameters
- $args : array<string|int, mixed>
-
Search arguments.
Return values
array<string|int, mixed>|object —update()
Update a webhook.
public
update(WC_Webhook &$webhook) : mixed
Parameters
- $webhook : WC_Webhook
-
Webhook instance.
Tags
Return values
mixed —get_webhook_count()
Count webhooks.
protected
get_webhook_count([string $status = 'active' ]) : int
Parameters
- $status : string = 'active'
-
Status to count.
Tags
Return values
int —delete_transients()
Delete the transients used to cache a set of webhook IDs, optionally filtered by status.
private
delete_transients([string $status = '' ]) : mixed
Parameters
- $status : string = ''
-
Optional - status of cache to delete, or 'all' to delete all caches.
Tags
Return values
mixed —get_transient_key()
Get the transient key used to cache a set of webhook IDs, optionally filtered by status.
private
get_transient_key([string $status = '' ]) : string
Parameters
- $status : string = ''
-
Optional - status of cache key.
Tags
Return values
string —validate_status()
Check if a given string is in known statuses, based on return value of @see wc_get_webhook_statuses().
private
validate_status(string $status) : mixed
Parameters
- $status : string
-
Status to check.