PHP Class WC_Product_Attribute

Attributes can be global (taxonomy based) or local to the product itself. Uses ArrayAccess to be BW compatible with previous ways of reading attributes.
Since: 2.7.0
Author: WooThemes
Inheritance: implements ArrayAccess
Afficher le fichier Open project: woocommerce/woocommerce Class Usage Examples

Protected Properties

Свойство Type Description
$data array Data array.

Méthodes publiques

Méthode Description
get_data ( ) : array Returns all data for this object.
get_id ( ) : integer Get the ID.
get_name ( ) : integer Get name.
get_options ( ) : array Get options.
get_position ( ) : integer Get position.
get_slugs ( ) : array 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 | null Get taxonomy object.
get_terms ( ) : array | null Gets terms from the stored options.
get_variation ( ) : boolean Get if variation.
get_visible ( ) : boolean Get if visible.
is_taxonomy ( ) : boolean Return if this attribute is a taxonomy.
offsetExists ( string $offset ) : boolean offsetExists
offsetGet ( string $offset ) : mixed offsetGet
offsetSet ( string $offset, mixed $value ) offsetSet
offsetUnset ( string $offset ) offsetUnset
set_id ( integer $value ) Set ID (this is the attribute ID).
set_name ( integer $value ) Set name (this is the attribute name or taxonomy).
set_options ( array $value ) Set options.
set_position ( integer $value ) Set position.
set_variation ( boolean $value ) Set if variation.
set_visible ( boolean $value ) Set if visible.

Method Details

get_data() public méthode

Returns all data for this object.
public get_data ( ) : array
Résultat array

get_id() public méthode

Get the ID.
public get_id ( ) : integer
Résultat integer

get_name() public méthode

Get name.
public get_name ( ) : integer
Résultat integer

get_options() public méthode

Get options.
public get_options ( ) : array
Résultat array

get_position() public méthode

Get position.
public get_position ( ) : integer
Résultat integer

get_slugs() public méthode

Gets slugs from the stored options, or just the string if text based.
public get_slugs ( ) : array
Résultat array

get_taxonomy() public méthode

Get taxonomy name if applicable.
public get_taxonomy ( ) : string
Résultat string

get_taxonomy_object() public méthode

Get taxonomy object.
public get_taxonomy_object ( ) : array | null
Résultat array | null

get_terms() public méthode

Gets terms from the stored options.
public get_terms ( ) : array | null
Résultat array | null

get_variation() public méthode

Get if variation.
public get_variation ( ) : boolean
Résultat boolean

get_visible() public méthode

Get if visible.
public get_visible ( ) : boolean
Résultat boolean

is_taxonomy() public méthode

Return if this attribute is a taxonomy.
public is_taxonomy ( ) : boolean
Résultat boolean

offsetExists() public méthode

offsetExists
public offsetExists ( string $offset ) : boolean
$offset string
Résultat boolean

offsetGet() public méthode

offsetGet
public offsetGet ( string $offset ) : mixed
$offset string
Résultat mixed

offsetSet() public méthode

offsetSet
public offsetSet ( string $offset, mixed $value )
$offset string
$value mixed

offsetUnset() public méthode

offsetUnset
public offsetUnset ( string $offset )
$offset string

set_id() public méthode

Set ID (this is the attribute ID).
public set_id ( integer $value )
$value integer

set_name() public méthode

Set name (this is the attribute name or taxonomy).
public set_name ( integer $value )
$value integer

set_options() public méthode

Set options.
public set_options ( array $value )
$value array

set_position() public méthode

Set position.
public set_position ( integer $value )
$value integer

set_variation() public méthode

Set if variation.
public set_variation ( boolean $value )
$value boolean

set_visible() public méthode

Set if visible.
public set_visible ( boolean $value )
$value boolean

Property Details

$data protected_oe property

Data array.
Since: 2.7.0
protected array $data
Résultat array