WC_Meta_Data
in package
implements
JsonSerializable
Meta data class.
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- $current_data : array
- Current data for metadata
- $data : array
- Metadata data
- __construct() : mixed
- Constructor.
- __get() : mixed
- Returns the value of any property.
- __isset() : bool
- Checks if a given key exists in our data. This is called internally by `empty` and `isset`.
- __set() : mixed
- Creates or updates a property in the metadata object.
- apply_changes() : mixed
- Merge changes with data and clear.
- get_changes() : array
- Return data changes only.
- get_data() : array
- Return all data as an array.
- jsonSerialize() : object|array
- When converted to JSON.
Properties
$current_data
Current data for metadata
protected
array
$current_data
Tags
$data
Metadata data
protected
array
$data
Tags
Methods
__construct()
Constructor.
public
__construct([array $meta = array() ]) : mixed
Parameters
- $meta : array = array()
-
Data to wrap behind this function.
Return values
mixed__get()
Returns the value of any property.
public
__get(string $key) : mixed
Parameters
- $key : string
-
Key to get.
Return values
mixed — Property value or NULL if it does not exists__isset()
Checks if a given key exists in our data. This is called internally by `empty` and `isset`.
public
__isset(string $key) : bool
Parameters
- $key : string
-
Key to check if set.
Return values
bool__set()
Creates or updates a property in the metadata object.
public
__set(string $key, mixed $value) : mixed
Parameters
- $key : string
-
Key to set.
- $value : mixed
-
Value to set.
Return values
mixedapply_changes()
Merge changes with data and clear.
public
apply_changes() : mixed
Return values
mixedget_changes()
Return data changes only.
public
get_changes() : array
Return values
arrayget_data()
Return all data as an array.
public
get_data() : array
Return values
arrayjsonSerialize()
When converted to JSON.
public
jsonSerialize() : object|array