WooCommerce Code Reference

BaseProductInput
in package
Uses TracksProvidedFields

Shared fields for product creation and update input types.

Table of Contents

$description  : string|null
$dimensions  : DimensionsInput|null
$manage_stock  : bool|null
$product_type  : ProductType|null
$regular_price  : float|null
$sale_price  : float|null
$short_description  : string|null
$sku  : string|null
$slug  : string|null
$status  : ProductStatus|null
$stock_quantity  : 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