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

Private settings for entities. More...

Public Member Functions

 __construct (Database $db, EntityTable $entities, PrivateSettingsCache $cache)
 Constructor. More...
 
 get (ElggEntity $entity, $name)
 Gets a private setting for an entity. More...
 
 getAllForEntity (ElggEntity $entity)
 Return an array of all private settings. More...
 
 getAllForGUIDs ($guids)
 Return an array of all private settings for the requested guids. More...
 
 set (ElggEntity $entity, $name, $value)
 Sets a private setting for an entity. More...
 
 remove (ElggEntity $entity, $name)
 Deletes a private setting for an entity. More...
 
 removeAllForEntity (ElggEntity $entity)
 Deletes all private settings for an entity. More...
 

Protected Attributes

 $db
 
 $entities
 
 $cache
 

Detailed Description

Private settings for entities.

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

Definition at line 18 of file PrivateSettingsTable.php.

Constructor & Destructor Documentation

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

Constructor.

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

Definition at line 42 of file PrivateSettingsTable.php.

Member Function Documentation

Elgg\Database\PrivateSettingsTable::get ( ElggEntity  $entity,
  $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
ElggEntity$entityThe entity GUID
string$nameThe name of the setting
Returns
mixed The setting value, or null if does not exist

Definition at line 59 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::getAllForEntity ( ElggEntity  $entity)

Return an array of all private settings.

Parameters
ElggEntity$entityEntity
Returns
string[] empty array if no settings

Definition at line 70 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::getAllForGUIDs (   $guids)

Return an array of all private settings for the requested guids.

Note
this does not use cache as this is a helper function for the privatesettingscache which does the caching
See also
::populateFromEntities()
Parameters
int[]$guids GUIDS to fetch the settings for
Returns
string[] array of guids and their settings

Definition at line 109 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::remove ( ElggEntity  $entity,
  $name 
)

Deletes a private setting for an entity.

Parameters
ElggEntity$entityEntity
string$nameThe name of the setting
Returns
bool

Definition at line 185 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::removeAllForEntity ( ElggEntity  $entity)

Deletes all private settings for an entity.

Parameters
ElggEntity$entityEntity
Returns
bool

Definition at line 202 of file PrivateSettingsTable.php.

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

Sets a private setting for an entity.

Parameters
ElggEntity$entityEntity
string$nameThe name of the setting
string | int$valueThe value of the setting
Returns
bool

Definition at line 145 of file PrivateSettingsTable.php.

Member Data Documentation

Elgg\Database\PrivateSettingsTable::$cache
protected

Definition at line 33 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::$db
protected

Definition at line 23 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::$entities
protected

Definition at line 28 of file PrivateSettingsTable.php.


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