Elgg  Version 3.0
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.

WARNING: API IN FLUX. DO NOT USE DIRECTLY.

Definition at line 22 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 46 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
Exceptions
DatabaseException

Definition at line 64 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
Exceptions
DatabaseException

Definition at line 76 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
Exceptions
DatabaseException

Definition at line 116 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
Exceptions
DatabaseException

Definition at line 194 of file PrivateSettingsTable.php.

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

Deletes all private settings for an entity.

Parameters
ElggEntity$entityEntity
Returns
bool
Exceptions
DatabaseException

Definition at line 212 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
Exceptions
DatabaseException

Definition at line 153 of file PrivateSettingsTable.php.

Member Data Documentation

Elgg\Database\PrivateSettingsTable::$cache
protected

Definition at line 37 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::$db
protected

Definition at line 27 of file PrivateSettingsTable.php.

Elgg\Database\PrivateSettingsTable::$entities
protected

Definition at line 32 of file PrivateSettingsTable.php.


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