PHP Класс Elgg\Database\SubtypeTable

С версии: 1.10.0
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$cache stdClass[] | null
$db Elgg\Database

Открытые методы

Метод Описание
__construct ( Database $db ) Constructor
add ( string $type, string $subtype, string $class = "" ) : integer Register \ElggEntities with a certain type and subtype to be loaded as a specific class.
getClass ( string $type, string $subtype ) : string | null Return the class name for a registered type and subtype.
getClassFromId ( integer $subtype_id ) : string | null Returns the class name for a subtype id.
getId ( string $type, string $subtype ) : integer Return the id for a given subtype.
getSubtype ( integer $subtype_id ) : string | false Gets the denormalized string for a given subtype ID.
remove ( string $type, string $subtype ) : boolean Removes a registered \ElggEntity type, subtype, and classname.
retrieveFromCache ( string $type, string $subtype ) : stdClass | null Retrieve subtype from the cache.
setCachedValues ( array $values ) : void Set the cached values from the boot data
update ( string $type, string $subtype, string $class = '' ) : boolean Update a registered \ElggEntity type, subtype, and class name

Защищенные методы

Метод Описание
getPopulatedCache ( ) : array Get a populated cache object
invalidateCache ( ) : void Empty the cache. Also invalidates the boot cache and memcache

Описание методов

__construct() публичный Метод

Constructor
public __construct ( Database $db )
$db Elgg\Database Elgg database

add() публичный Метод

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 {@link get_entity()}.
См. также: update_subtype()
См. также: remove_subtype()
См. также: get_entity()
public add ( string $type, string $subtype, string $class = "" ) : integer
$type string The type you're subtyping (site, user, object, or group)
$subtype string The subtype
$class string Optional class name for the object
Результат integer

getClass() публичный Метод

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.
См. также: get_subtype_from_id()
См. также: get_subtype_class_from_id()
public getClass ( string $type, string $subtype ) : string | null
$type string The type
$subtype string The subtype
Результат string | null a class name or null

getClassFromId() публичный Метод

Returns the class name for a subtype id.
См. также: get_subtype_class()
См. также: get_subtype_from_id()
public getClassFromId ( integer $subtype_id ) : string | null
$subtype_id integer The subtype id
Результат string | null

getId() публичный Метод

\ElggEntity 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 {@link \ElggEntity::getSubtype()} to return the string subtype.
См. также: get_subtype_from_id()
public getId ( string $type, string $subtype ) : integer
$type string Type
$subtype string Subtype
Результат integer Subtype ID

getPopulatedCache() защищенный Метод

Get a populated cache object
protected getPopulatedCache ( ) : array
Результат array

getSubtype() публичный Метод

Gets the denormalized string for a given subtype ID.
См. также: get_subtype_id()
public getSubtype ( integer $subtype_id ) : string | false
$subtype_id integer Subtype ID from database
Результат string | false Subtype name, false if subtype not found

invalidateCache() защищенный Метод

Empty the cache. Also invalidates the boot cache and memcache
protected invalidateCache ( ) : void
Результат void

remove() публичный Метод

Removes a registered \ElggEntity type, subtype, and classname.
См. также: add_subtype()
См. также: update_subtype()
public remove ( string $type, string $subtype ) : boolean
$type string Type
$subtype string Subtype
Результат boolean

retrieveFromCache() публичный Метод

Retrieve subtype from the cache.
public retrieveFromCache ( string $type, string $subtype ) : stdClass | null
$type string
$subtype string
Результат stdClass | null

setCachedValues() публичный Метод

Set the cached values from the boot data
public setCachedValues ( array $values ) : void
$values array Values from boot data
Результат void

update() публичный Метод

Update a registered \ElggEntity type, subtype, and class name
public update ( string $type, string $subtype, string $class = '' ) : boolean
$type string Type
$subtype string Subtype
$class string Class name to use when loading this entity
Результат boolean

Описание свойств

$cache защищенное свойство

protected stdClass[]|null $cache
Результат stdClass[] | null

$db защищенное свойство

protected Database,Elgg $db
Результат Elgg\Database