Methods summary
public
array
|
#
keys( )
Gets the data keys on this entity.
Gets the data keys on this entity.
Returns
array
Implementation of
|
public
array
|
#
data( array $keys = null )
Gets all data, or a subset, from this entity.
Gets all data, or a subset, from this entity.
Parameters
- $keys
- Optional. Extracts only the requested data.
Returns
array Key-value array of data, excluding pairs with NULL values.
Uses
Implementation of
|
public
Charcoal\Config\AbstractEntity
|
#
setData( array $data )
Sets data on this entity.
Sets data on this entity.
Parameters
- $data
- Key-value array of data to append.
Returns
Uses
Implementation of
|
public
boolean
|
#
has( string $key )
Determines if this entity contains the specified key and if its value is not NULL.
Determines if this entity contains the specified key and if its value is not NULL.
Parameters
- $key
- The data key to check.
Returns
boolean TRUE if $key exists and has a value other than NULL, FALSE otherwise.
Uses
Implementation of
|
public
mixed
|
#
get( string $key )
Find an entry of the configuration by its key and retrieve it.
Find an entry of the configuration by its key and retrieve it.
Parameters
- $key
- The data key to retrieve.
Returns
mixed Value of the requested $key on success, NULL if the $key is not set.
Uses
Implementation of
|
public
Charcoal\Config\AbstractEntity
|
#
set( string $key, mixed $value )
Assign a value to the specified key on this entity.
Assign a value to the specified key on this entity.
Parameters
- $key
- The data key to assign $value to.
- $value
- The data value to assign to $key.
Returns
Uses
Implementation of
|
public
boolean
|
#
offsetExists( string $key )
Determines if this entity contains the specified key and if its value is not NULL.
Determines if this entity contains the specified key and if its value is not NULL.
Routine:
- If the entity has a getter method (e.g., "foo_bar" → fooBar() ), its called and its value is checked;
- If the entity has a property (e.g., $fooBar ), its value is checked;
- If the entity has neither, FALSE is returned.
Parameters
- $key
- The data key to check.
Returns
boolean TRUE if $key exists and has a value other than NULL, FALSE otherwise.
Throws
InvalidArgumentException If the $key is not a string or is a numeric value.
See
\ArrayAccess
Used by
|
public
mixed
|
#
offsetGet( string $key )
Returns the value from the specified key on this entity.
Returns the value from the specified key on this entity.
Routine:
- If the entity has a getter method (e.g., "foo_bar" → fooBar() ), its called and returns its value;
- If the entity has a property (e.g., $fooBar ), its value is returned;
- If the entity has neither, NULL is returned.
Parameters
- $key
- The data key to retrieve.
Returns
mixed Value of the requested $key on success, NULL if the $key is not set.
Throws
InvalidArgumentException If the $key is not a string or is a numeric value.
See
\ArrayAccess
Used by
|
public
|
#
offsetSet( string $key, mixed $value )
Assigns the value to the specified key on this entity.
Assigns the value to the specified key on this entity.
Routine:
- The data key is added to the entity's key pool.
- If the entity has a setter method (e.g., "foo_bar" → setFooBar() ), its called and passed the value;
- If the entity has NO setter method, the value is assigned to a property (e.g., $fooBar ).
Parameters
- $key
- The data key to assign $value to.
- $value
- The data value to assign to $key.
Throws
InvalidArgumentException If the $key is not a string or is a numeric value.
See
\ArrayAccess
Used by
|
public
|
#
offsetUnset( string $key )
Removes the value from the specified key on this entity.
Removes the value from the specified key on this entity.
Routine:
- The data key is removed from the entity's key pool.
- NULL is assigned to the entity.
Parameters
- $key
- The data key to remove.
Throws
InvalidArgumentException If the $key is not a string or is a numeric value.
See
\ArrayAccess
Uses
|
public
array
|
#
jsonSerialize( )
Gets the data that can be serialized with json_encode().
Gets the data that can be serialized with json_encode().
Returns
array Key-value array of data.
See
\JsonSerializable
|
public
string
|
#
serialize( )
Serializes the data on this entity.
Serializes the data on this entity.
Returns
string Returns a string containing a byte-stream representation of the object.
See
\Serializable
|
public
|
#
unserialize( string $data )
Applies the serialized data to this entity.
Applies the serialized data to this entity.
Parameters
- $data
- The serialized data to extract.
See
\Serializable
|
final protected
string
|
#
camelize( string $str )
Transform a string from "snake_case" to "camelCase".
Transform a string from "snake_case" to "camelCase".
Parameters
- $str
- The string to camelize.
Returns
string The camelized string.
|