This class interfaces with the database to perform CRUD operations on metadata.
More...
|
| getIDsByName (int $entity_guid, string $name) |
| Returns ID(s) of metadata with a particular name attached to an entity. More...
|
|
This class interfaces with the database to perform CRUD operations on metadata.
Definition at line 19 of file MetadataTable.php.
Elgg\Database\MetadataTable::create |
( |
\ElggMetadata |
$metadata, |
|
|
bool |
$allow_multiple = false |
|
) |
| |
Create a new metadata object, or update an existing one (if multiple is allowed)
Metadata can be an array by setting allow_multiple to true, but it is an indexed array with no control over the indexing
- Parameters
-
\ElggMetadata | $metadata | Metadata |
bool | $allow_multiple | Allow multiple values for one key. Default is false |
- Returns
- int|false id of metadata or false if failure
- Exceptions
-
Definition at line 201 of file MetadataTable.php.
Elgg\Database\MetadataTable::delete |
( |
\ElggMetadata |
$metadata | ) |
|
Deletes metadata using its ID.
- Parameters
-
- Returns
- bool
Definition at line 168 of file MetadataTable.php.
Elgg\Database\MetadataTable::deleteAll |
( |
array |
$options | ) |
|
Elgg\Database\MetadataTable::get |
( |
int |
$id | ) |
|
Elgg\Database\MetadataTable::getAll |
( |
array |
$options = [] | ) |
|
Elgg\Database\MetadataTable::getIDsByName |
( |
int |
$entity_guid, |
|
|
string |
$name |
|
) |
| |
|
protected |
Returns ID(s) of metadata with a particular name attached to an entity.
- Parameters
-
- Returns
- int[]|int|null
Definition at line 436 of file MetadataTable.php.
Elgg\Database\MetadataTable::getRowsForGuids |
( |
array |
$guids | ) |
|
Returns metadata rows.
Used internally for metadata preloading
- Parameters
-
array | $guids | Array of guids to fetch metadata rows for |
- Returns
- []
Definition at line 353 of file MetadataTable.php.
Elgg\Database\MetadataTable::getTags |
( |
array |
$options = [] | ) |
|
Get popular tags and their frequencies.
Accepts all options supported by {
- See also
- elgg_get_metadata()}
Returns an array of objects that include "tag" and "total" properties
- Parameters
-
int $threshold Minimum number of tag occurrences string[] $tag_names tag names to include in search
- Returns
- []|false
Definition at line 71 of file MetadataTable.php.
Elgg\Database\MetadataTable::update |
( |
\ElggMetadata |
$metadata | ) |
|
Update a specific piece of metadata.
- Parameters
-
\ElggMetadata | $metadata | Updated metadata |
- Returns
- bool
Definition at line 290 of file MetadataTable.php.
Database Elgg\Database\MetadataTable::$db |
|
protected |
Events Elgg\Database\MetadataTable::$events |
|
protected |
const Elgg\Database\MetadataTable::DEFAULT_JOIN_ALIAS = 'n_table' |
const Elgg\Database\MetadataTable::MYSQL_TEXT_BYTE_LIMIT = 65535 |
|
protected |
const Elgg\Database\MetadataTable::TABLE_NAME = 'metadata' |
The documentation for this class was generated from the following file: