Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | List of all members
Elgg\Database\PrivateSettingsTable Class Reference

Private settings for entities. More...

Public Member Functions

 __construct (Database $db, EntityTable $entities, PluginSettingsCache $cache)
 Constructor. More...
 
 getEntities (array $options=array())
 Returns entities based upon private settings. More...
 
 get ($entity_guid, $name)
 Gets a private setting for an entity. More...
 
 getAll ($entity_guid)
 Return an array of all private settings. More...
 
 set ($entity_guid, $name, $value)
 Sets a private setting for an entity. More...
 
 remove ($entity_guid, $name)
 Deletes a private setting for an entity. More...
 
 removeAllForEntity ($entity_guid)
 Deletes all private settings for an entity. More...
 

Detailed Description

Private settings for entities.

Private settings provide metadata like storage of settings for plugins and users.

WARNING: API IN FLUX. DO NOT USE DIRECTLY.

private

Since
2.0.0

Definition at line 19 of file PrivateSettingsTable.php.

Constructor & Destructor Documentation

Elgg\Database\PrivateSettingsTable::__construct ( Database  $db,
EntityTable  $entities,
PluginSettingsCache  $cache 
)

Constructor.

Parameters
Database$dbThe database
EntityTable$entitiesEntities table
PluginSettingsCache$cacheSettings cache

Definition at line 40 of file PrivateSettingsTable.php.

Member Function Documentation

Elgg\Database\PrivateSettingsTable::get (   $entity_guid,
  $name 
)

Gets a private setting for an entity.

Plugin authors can set private data on entities. By default private data will not be searched or exported.

Parameters
int$entity_guidThe entity GUID
string$nameThe name of the setting
Returns
mixed The setting value, or null if does not exist

Definition at line 306 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::getAll (   $entity_guid)

Return an array of all private settings.

Parameters
int$entity_guidThe entity GUID
Returns
string[] empty array if no settings

Definition at line 339 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::getEntities ( array  $options = array())

Returns entities based upon private settings.

Also accepts all options available to elgg_get_entities(). Supports the singular option shortcut.

Parameters
array$optionsArray in format:

private_setting_names => null|ARR private setting names

private_setting_values => null|ARR metadata values

private_setting_name_value_pairs => null|ARR ( name => 'name', value => 'value', 'operand' => '=', ) Currently if multiple values are sent via an array (value => array('value1', 'value2') the pair's operand will be forced to "IN".

private_setting_name_value_pairs_operator => null|STR The operator to use for combining (name = value) OPERATOR (name = value); default AND

private_setting_name_prefix => STR A prefix to apply to all private settings. Used to namespace plugin user settings or by plugins to namespace their own settings.

Returns
mixed int If count, int. If not count, array. false on errors.

Definition at line 80 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::remove (   $entity_guid,
  $name 
)

Deletes a private setting for an entity.

Parameters
int$entity_guidThe Entity GUID
string$nameThe name of the setting
Returns
bool

Definition at line 393 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::removeAllForEntity (   $entity_guid)

Deletes all private settings for an entity.

Parameters
int$entity_guidThe Entity GUID
Returns
bool

Definition at line 418 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::set (   $entity_guid,
  $name,
  $value 
)

Sets a private setting for an entity.

Parameters
int$entity_guidThe entity GUID
string$nameThe name of the setting
string$valueThe value of the setting
Returns
bool

Definition at line 370 of file PrivateSettingsTable.php.


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