$db
$db : object
Laci document object.
__construct(\TriTan\Database $db, \TriTan\Interfaces\ContextInterface $context)
\TriTan\Database | $db | |
\TriTan\Interfaces\ContextInterface | $context |
read(string $meta_type, integer $array_id, string $meta_key = '', $single = false) : mixed
Retrieve metadata for the specified array.
string | $meta_type | Type of array metadata is for (e.g. post or user) |
integer | $array_id | ID of the array metadata is for |
string | $meta_key | Optional. Metadata key. If not specified, retrieve all metadata for the specified array. |
$single |
Array of values
update(string $meta_type, integer $array_id, string $meta_key, mixed $meta_value, mixed $prev_value = '') : integer|boolean
Update metadata for the specified array. If no value already exists for the specified array ID and metadata key, the metadata will be added.
string | $meta_type | Type of array metadata is for (e.g. post or user) |
integer | $array_id | ID of the array metadata is for |
string | $meta_key | Metadata key |
mixed | $meta_value | Metadata value. Must be serializable if non-scalar. |
mixed | $prev_value | Optional. If specified, only update existing metadata entries with the specified value. Otherwise, update all entries. |
Meta ID if the key didn't exist, true on successful update, false on failure.
create(string $meta_type, integer $array_id, string $meta_key, mixed $meta_value, $unique = false) : integer|false
Add metadata for the specified array.
string | $meta_type | Type of array metadata is for (e.g. post or user) |
integer | $array_id | ID of the array metadata is for |
string | $meta_key | Metadata key |
mixed | $meta_value | Metadata value. Must be serializable if non-scalar. |
$unique |
The meta ID on success, false on failure.
delete(string $meta_type, integer $array_id, string $meta_key, mixed $meta_value = '', boolean $delete_all = false) : boolean
Delete metadata for the specified array.
string | $meta_type | Type of array metadata is for (e.g. post or user) |
integer | $array_id | ID of the array metadata is for |
string | $meta_key | Metadata key |
mixed | $meta_value | Optional. Metadata value. Must be serializable if non-scalar. If specified, only delete
metadata entries with this value. Otherwise, delete all entries with the specified meta_key.
Pass |
boolean | $delete_all | Optional, default is false. If true, delete matching metadata entries for all arrays, ignoring the specified array_id. Otherwise, only delete matching metadata entries for the specified array_id. |
True on successful delete, false on failure.
exists(string $meta_type, integer $array_id, string $meta_key) : boolean
Determine if a meta key is set for a given array
string | $meta_type | Type of array metadata is for (e.g. post or user) |
integer | $array_id | ID of the array metadata is for |
string | $meta_key | Metadata key. |
True of the key is set, false if not.
updateByMid(string $meta_type, integer $meta_id, string $meta_value, string $meta_key = false) : boolean
Update meta data by meta ID
string | $meta_type | Type of array metadata is for (e.g. post or user) |
integer | $meta_id | ID for a specific meta row |
string | $meta_value | Metadata value |
string | $meta_key | Optional, you can provide a meta key to update it |
True on successful update, false on failure.
updateMetaDataCache(string $meta_type, integer|array $array_ids) : array|false
Update the metadata cache for the specified arrays.
string | $meta_type | Type of array metadata is for (e.g., post or user) |
integer|array | $array_ids | Array or comma delimited list of array IDs to update cache for |
Metadata cache for the specified arrays, or false on failure.
table(string $type) : string
Retrieve the name of the metadata table for the specified object type.
This public function is not to be used by developers. It's use is only for _metadata methods.
string | $type | Type of object to get metadata table for (e.g. post or user) |
Metadata document name.