Meta
in package
Class to handle meta data of a class Usage examples: table name, table fields definition, etc.
Table of Contents
- $values : array<string|int, mixed>
- Container for all the meta values
- __construct() : mixed
- add() : Meta
- Add a key/value pair
- get() : mixed
- Get a meta value
- getAliasOrTable() : string
- Utility method to get the actual table name even if it's aliased. Used to perform queries.
- has() : bool
- Check if the key exists in the meta data array
- remove() : Meta
- Remove the selected path element from the meta values
- set() : Meta
- Set a value in a determined path.
Properties
$values
Container for all the meta values
public
array<string|int, mixed>
$values
Methods
__construct()
public
__construct() : mixed
Return values
mixed —add()
Add a key/value pair
public
add(mixed $key, mixed $value) : Meta
Parameters
- $key : mixed
- $value : mixed
Return values
Meta —get()
Get a meta value
public
get(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
Return values
mixed —getAliasOrTable()
Utility method to get the actual table name even if it's aliased. Used to perform queries.
public
getAliasOrTable(string $alias) : string
Parameters
- $alias : string
Return values
string —has()
Check if the key exists in the meta data array
public
has(string $name) : bool
Parameters
- $name : string
Return values
bool —remove()
Remove the selected path element from the meta values
public
remove(string $path) : Meta
Parameters
- $path : string
Return values
Meta —set()
Set a value in a determined path.
public
set(mixed $path, mixed $value[, string $container = 'array' ]) : Meta
If the path doesn't exist, the missing parts are created.
Parameters
- $path : mixed
- $value : mixed
- $container : string = 'array'