WC_Product_Attribute
in package
implements
ArrayAccess
Product attribute class.
Interfaces, Classes and Traits
- ArrayAccess
Table of Contents
- $data : array<string|int, mixed>
- Data array.
- get_data() : array<string|int, mixed>
- Returns all data for this object.
- get_id() : int
- Get the ID.
- get_name() : string
- Get name.
- get_options() : array<string|int, mixed>
- Get options.
- get_position() : int
- Get position.
- get_slugs() : array<string|int, mixed>
- Gets slugs from the stored options, or just the string if text based.
- get_taxonomy() : string
- Get taxonomy name if applicable.
- get_taxonomy_object() : array<string|int, mixed>|null
- Get taxonomy object.
- get_terms() : array<string|int, mixed>|null
- Gets terms from the stored options.
- get_variation() : bool
- Get if variation.
- get_visible() : bool
- Get if visible.
- is_taxonomy() : bool
- Return if this attribute is a taxonomy.
- offsetExists() : bool
- OffsetExists.
- offsetGet() : mixed
- OffsetGet.
- offsetSet() : mixed
- OffsetSet.
- offsetUnset() : mixed
- OffsetUnset.
- set_id() : mixed
- Set ID (this is the attribute ID).
- set_name() : mixed
- Set name (this is the attribute name or taxonomy).
- set_options() : mixed
- Set options.
- set_position() : mixed
- Set position.
- set_variation() : mixed
- Set if variation.
- set_visible() : mixed
- Set if visible.
Properties
$data
Data array.
protected
array<string|int, mixed>
$data
= array('id' => 0, 'name' => '', 'options' => array(), 'position' => 0, 'visible' => alse, 'variation' => alse)
Tags
Methods
get_data()
Returns all data for this object.
public
get_data() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_id()
Get the ID.
public
get_id() : int
Return values
int —get_name()
Get name.
public
get_name() : string
Return values
string —get_options()
Get options.
public
get_options() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_position()
Get position.
public
get_position() : int
Return values
int —get_slugs()
Gets slugs from the stored options, or just the string if text based.
public
get_slugs() : array<string|int, mixed>
Return values
array<string|int, mixed> —get_taxonomy()
Get taxonomy name if applicable.
public
get_taxonomy() : string
Return values
string —get_taxonomy_object()
Get taxonomy object.
public
get_taxonomy_object() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —get_terms()
Gets terms from the stored options.
public
get_terms() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null —get_variation()
Get if variation.
public
get_variation() : bool
Return values
bool —get_visible()
Get if visible.
public
get_visible() : bool
Return values
bool —is_taxonomy()
Return if this attribute is a taxonomy.
public
is_taxonomy() : bool
Return values
bool —offsetExists()
OffsetExists.
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
-
Offset.
Return values
bool —offsetGet()
OffsetGet.
public
offsetGet(string $offset) : mixed
Parameters
- $offset : string
-
Offset.
Return values
mixed —offsetSet()
OffsetSet.
public
offsetSet(string $offset, mixed $value) : mixed
Parameters
- $offset : string
-
Offset.
- $value : mixed
-
Value.
Return values
mixed —offsetUnset()
OffsetUnset.
public
offsetUnset(string $offset) : mixed
Parameters
- $offset : string
-
Offset.
Return values
mixed —set_id()
Set ID (this is the attribute ID).
public
set_id(int $value) : mixed
Parameters
- $value : int
-
Attribute ID.
Return values
mixed —set_name()
Set name (this is the attribute name or taxonomy).
public
set_name(string $value) : mixed
Parameters
- $value : string
-
Attribute name.
Return values
mixed —set_options()
Set options.
public
set_options(array<string|int, mixed> $value) : mixed
Parameters
- $value : array<string|int, mixed>
-
Attribute options.
Return values
mixed —set_position()
Set position.
public
set_position(int $value) : mixed
Parameters
- $value : int
-
Attribute position.
Return values
mixed —set_variation()
Set if variation.
public
set_variation(bool $value) : mixed
Parameters
- $value : bool
-
If is used for variations.
Return values
mixed —set_visible()
Set if visible.
public
set_visible(bool $value) : mixed
Parameters
- $value : bool
-
If is visible on Product's additional info tab.