PHP 클래스 Elgg\Cache\MetadataCache

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

보호된 프로퍼티들

프로퍼티 타입 설명
$session ElggSession
$values array The cached values (or null for known to be empty).

공개 메소드들

메소드 설명
__construct ( ElggSession $session ) Constructor
clear ( integer $entity_guid ) : void Forget about all metadata for an entity. For safety this affects all access states.
clearAll ( ) : void Clear entire cache
filterMetadataHeavyEntities ( array $guids, integer $limit = 1024000 ) : array Filter out entities whose concatenated metadata values (INTs casted as string) exceed a threshold in characters. This could be used to avoid overpopulating the cache if RAM usage becomes an issue.
getSingle ( integer $entity_guid, string $name ) : array | string | integer | null Get the metadata for a particular name. Note, this can return an array of values.
inject ( integer $entity_guid, array $values ) : void Set the visible metadata for an entity in the cache
invalidateByOptions ( array $options ) : void Invalidate based on options passed to the global *_metadata functions
isLoaded ( integer $entity_guid ) : boolean If true, getSingle() will return an accurate values from the DB
populateFromEntities ( integer | array $guids ) : void Populate the cache from a set of entities

보호된 메소드들

메소드 설명
getAccessKey ( ) : string Get a key to represent the access ability of the system. This is used to shard the cache array.

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( ElggSession $session )
$session ElggSession The session service

clear() 공개 메소드

Forget about all metadata for an entity. For safety this affects all access states.
public clear ( integer $entity_guid ) : void
$entity_guid integer The GUID of the entity
리턴 void

clearAll() 공개 메소드

Clear entire cache
public clearAll ( ) : void
리턴 void

filterMetadataHeavyEntities() 공개 메소드

Filter out entities whose concatenated metadata values (INTs casted as string) exceed a threshold in characters. This could be used to avoid overpopulating the cache if RAM usage becomes an issue.
public filterMetadataHeavyEntities ( array $guids, integer $limit = 1024000 ) : array
$guids array GUIDs of entities to examine
$limit integer Limit in characters of all metadata (with ints casted to strings)
리턴 array

getAccessKey() 보호된 메소드

Get a key to represent the access ability of the system. This is used to shard the cache array.
protected getAccessKey ( ) : string
리턴 string E.g. "ignored" or "123"

getSingle() 공개 메소드

Warning: You should always call isLoaded() beforehand to verify that this function's return value can be trusted.
또한 보기: isLoaded
public getSingle ( integer $entity_guid, string $name ) : array | string | integer | null
$entity_guid integer The GUID of the entity
$name string The metadata name
리턴 array | string | integer | null null = value does not exist

inject() 공개 메소드

Note this does NOT invalidate any other part of the cache.
public inject ( integer $entity_guid, array $values ) : void
$entity_guid integer The GUID of the entity
$values array The metadata values to cache
리턴 void

invalidateByOptions() 공개 메소드

Invalidate based on options passed to the global *_metadata functions
public invalidateByOptions ( array $options ) : void
$options array Options passed to elgg_(delete|disable|enable)_metadata "guid" if given, invalidation will be limited to this entity
리턴 void

isLoaded() 공개 메소드

If true, getSingle() will return an accurate values from the DB
public isLoaded ( integer $entity_guid ) : boolean
$entity_guid integer The GUID of the entity
리턴 boolean

populateFromEntities() 공개 메소드

Populate the cache from a set of entities
public populateFromEntities ( integer | array $guids ) : void
$guids integer | array Array of or single GUIDs
리턴 void

프로퍼티 상세

$session 보호되어 있는 프로퍼티

protected ElggSession $session
리턴 ElggSession

$values 보호되어 있는 프로퍼티

The cached values (or null for known to be empty).
protected array $values
리턴 array