Elgg
Version 2.3
|
Public Member Functions | |
__construct (Database $db) | |
Constructor. More... | |
setCachedValues (array $values) | |
Set the cached values from the boot data. More... | |
getId ($type, $subtype) | |
Return the id for a given subtype. More... | |
getSubtype ($subtype_id) | |
Gets the denormalized string for a given subtype ID. More... | |
retrieveFromCache ($type, $subtype) | |
Retrieve subtype from the cache. More... | |
getClass ($type, $subtype) | |
Return the class name for a registered type and subtype. More... | |
getClassFromId ($subtype_id) | |
Returns the class name for a subtype id. More... | |
add ($type, $subtype, $class="") | |
Register with a certain type and subtype to be loaded as a specific class. More... | |
remove ($type, $subtype) | |
Removes a registered type, subtype, and classname. More... | |
update ($type, $subtype, $class= '') | |
Update a registered type, subtype, and class name. More... | |
Protected Member Functions | |
invalidateCache () | |
Empty the cache. More... | |
getPopulatedCache () | |
Get a populated cache object. More... | |
Protected Attributes | |
$cache = null | |
$db | |
Definition at line 15 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::__construct | ( | Database | $db | ) |
Elgg\Database\SubtypeTable::add | ( | $type, | |
$subtype, | |||
$class = "" |
|||
) |
Register with a certain type and subtype to be loaded as a specific class.
By default entities are loaded as one of the 4 parent objects: site, user, object, or group. If you subclass any of these you can register the classname with add_subtype() so it will be loaded as that class automatically when retrieved from the database with get_entity().
string | $type | The type you're subtyping (site, user, object, or group) |
string | $subtype | The subtype |
string | $class | Optional class name for the object |
Definition at line 174 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::getClass | ( | $type, | |
$subtype | |||
) |
Return the class name for a registered type and subtype.
Entities can be registered to always be loaded as a certain class with add_subtype() or update_subtype(). This function returns the class name if found and null if not.
string | $type | The type |
string | $subtype | The subtype |
Definition at line 128 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::getClassFromId | ( | $subtype_id | ) |
Returns the class name for a subtype id.
int | $subtype_id | The subtype id |
Definition at line 144 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::getId | ( | $type, | |
$subtype | |||
) |
Return the id for a given subtype.
objects have a type and a subtype. Subtypes are defined upon creation and cannot be changed.
Plugin authors generally don't need to use this function unless writing their own SQL queries. Use ElggEntity::getSubtype()toreturnthestringsubtype.
Definition at line 66 of file SubtypeTable.php.
|
protected |
Elgg\Database\SubtypeTable::getSubtype | ( | $subtype_id | ) |
Gets the denormalized string for a given subtype ID.
int | $subtype_id | Subtype ID from database |
Definition at line 84 of file SubtypeTable.php.
|
protected |
Empty the cache.
Also invalidates the boot cache and memcache
Definition at line 272 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::remove | ( | $type, | |
$subtype | |||
) |
Removes a registered type, subtype, and classname.
string | $type | Type |
string | $subtype | Subtype |
Definition at line 214 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::retrieveFromCache | ( | $type, | |
$subtype | |||
) |
Retrieve subtype from the cache.
string | $type | |
string | $subtype |
private
Definition at line 103 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::setCachedValues | ( | array | $values | ) |
Set the cached values from the boot data.
array | $values | Values from boot data |
Definition at line 42 of file SubtypeTable.php.
Elgg\Database\SubtypeTable::update | ( | $type, | |
$subtype, | |||
$class = '' |
|||
) |
Update a registered type, subtype, and class name.
string | $type | Type |
string | $subtype | Subtype |
string | $class | Class name to use when loading this entity |
Definition at line 241 of file SubtypeTable.php.
|
protected |
Definition at line 20 of file SubtypeTable.php.
|
protected |
Definition at line 25 of file SubtypeTable.php.