PHP 클래스 Elgg\Database\SubtypeTable

부터: 1.10.0
파일 보기 프로젝트 열기: elgg/elgg 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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