Elgg  Version 2.3
Public Member Functions | Protected Attributes | List of all members
Elgg\Database\MetastringsTable Class Reference

Public Member Functions

 __construct (Pool $cache, Database $db)
 Constructor. More...
 
 getId ($string, $case_sensitive=true)
 Gets the metastring identifier for a value. More...
 
 getMap (array $string_keys)
 Get a map of strings to their metastring identifiers (case sensitive matches) More...
 
 add ($string)
 Add a metastring. More...
 
 getTableName ()
 The full name of the metastrings table, including prefix. More...
 

Protected Attributes

 $cache
 
 $db
 

Detailed Description

Definition at line 21 of file MetastringsTable.php.

Constructor & Destructor Documentation

Elgg\Database\MetastringsTable::__construct ( Pool  $cache,
Database  $db 
)

Constructor.

Parameters
Pool$cacheA cache for this table.
Database$dbThe database.

Definition at line 35 of file MetastringsTable.php.

Member Function Documentation

Elgg\Database\MetastringsTable::add (   $string)

Add a metastring.

Warning
You should not call this directly. Use elgg_get_metastring_id().
Parameters
string$stringThe value to be normalized
Returns
int The identifier for this string

Definition at line 176 of file MetastringsTable.php.

Elgg\Database\MetastringsTable::getId (   $string,
  $case_sensitive = true 
)

Gets the metastring identifier for a value.

Elgg normalizes the names and values of annotations and metadata. This function provides the identifier used as the index in the metastrings table. Plugin developers should only use this if denormalizing names/values for performance reasons (to avoid multiple joins on the metastrings table).

Parameters
string$stringThe value
bool$case_sensitiveShould the retrieval be case sensitive? If not, there may be more than one result
Returns
int|array metastring id or array of ids
See also
elgg_get_metastring_id

Definition at line 56 of file MetastringsTable.php.

Elgg\Database\MetastringsTable::getMap ( array  $string_keys)

Get a map of strings to their metastring identifiers (case sensitive matches)

Parameters
string[]$string_keys Strings to look up
Returns
int[] map of [string] => [id]
See also
elgg_get_metastring_map

Definition at line 73 of file MetastringsTable.php.

Elgg\Database\MetastringsTable::getTableName ( )

The full name of the metastrings table, including prefix.

Returns
string

Definition at line 189 of file MetastringsTable.php.

Member Data Documentation

Elgg\Database\MetastringsTable::$cache
protected

Definition at line 24 of file MetastringsTable.php.

Elgg\Database\MetastringsTable::$db
protected

Definition at line 27 of file MetastringsTable.php.


The documentation for this class was generated from the following file: