WooCommerce Code Reference

WC_Webhook_Data_Store implements WC_Webhook_Data_Store_Interface

Webhook data store class.

Interfaces, Classes and Traits

WC_Webhook_Data_Store_Interface
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
Get total webhook counts by status.
get_webhooks_ids()  : int[]
Get webhooks IDs from the database.
read()  : mixed
Read a webhook from the database.
search_webhooks()  : array|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

get_webhooks_ids()

Get webhooks IDs from the database.

public get_webhooks_ids([string $status = '' ]) : 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
since
3.3.0
throws
InvalidArgumentException

If a $status value is passed in that is not in the known wc_get_webhook_statuses() keys.

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
since
3.6.0
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
since
3.6.0
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.

Tags
since
3.6.0
throws
InvalidArgumentException

If $status is not empty and not in the known wc_get_webhook_statuses() keys.

Return values
mixed