WooCommerce Code Reference

UpdateCouponInput
in package
Uses TracksProvidedFields

Input type for updating a coupon.

Table of Contents

$amount  : float|null
$code  : string|null
$date_expires  : string|null
$description  : string|null
$discount_type  : DiscountType|null
$email_restrictions  : array<string|int, mixed>|null
$exclude_sale_items  : bool|null
$excluded_product_categories  : array<string|int, mixed>|null
$excluded_product_ids  : array<string|int, mixed>|null
$free_shipping  : bool|null
$id  : int
$individual_use  : bool|null
$limit_usage_to_x_items  : int|null
$maximum_amount  : float|null
$minimum_amount  : float|null
$product_categories  : array<string|int, mixed>|null
$product_ids  : array<string|int, mixed>|null
$status  : CouponStatus|null
$usage_limit  : int|null
$usage_limit_per_user  : int|null
$provided_fields  : array<string|int, mixed>
Fields that were explicitly provided in the input.
mark_provided()  : void
Mark a field as explicitly provided in the input.
was_provided()  : bool
Check whether a field was explicitly provided in the input.

Properties

$provided_fields

Fields that were explicitly provided in the input.

protected array<string|int, mixed> $provided_fields = array()

Using an underscore prefix to keep it invisible to the ApiBuilder (which only scans public properties for GraphQL fields).

Methods

mark_provided()

Mark a field as explicitly provided in the input.

public mark_provided(string $field) : void
Parameters
$field : string

The field name.

Return values
void

was_provided()

Check whether a field was explicitly provided in the input.

public was_provided(string $field) : bool
Parameters
$field : string

The field name.

Return values
bool