Elgg
Version 1.9
|
Public Member Functions | |
saveAll ($entity_guid, array $values) | |
Cache metadata for an entity. More... | |
loadAll ($entity_guid) | |
Get the metadata for an entity. More... | |
markOutOfSync ($entity_guid) | |
Declare that there may be fetch-able metadata names in storage that this cache doesn't know about. More... | |
isSynchronized ($entity_guid) | |
Have all the metadata for this entity been cached? More... | |
save ($entity_guid, $name, $value, $allow_multiple=false) | |
Cache a piece of metadata. More... | |
load ($entity_guid, $name) | |
Warning: You should always call isKnown() beforehand to verify that this function's return value should be trusted (otherwise a null return value is ambiguous). More... | |
markUnknown ($entity_guid, $name) | |
Forget about this metadata entry. More... | |
isKnown ($entity_guid, $name) | |
If true, load() will return an accurate value for this name. More... | |
markEmpty ($entity_guid, $name) | |
Declare that metadata under this name is known to be not fetch-able from storage. More... | |
clear ($entity_guid) | |
Forget about all metadata for an entity. More... | |
flush () | |
Clear entire cache and mark all entities as out of sync. More... | |
setIgnoreAccess ($ignore) | |
Use this value instead of calling elgg_get_ignore_access(). More... | |
unsetIgnoreAccess () | |
Tell the cache to call elgg_get_ignore_access() to determing access status. More... | |
invalidateByOptions ($action, array $options) | |
Invalidate based on options passed to the global *_metadata functions. More... | |
populateFromEntities ($guids) | |
Populate the cache from a set of entities. More... | |
filterMetadataHeavyEntities (array $guids, $limit=1024000) | |
Filter out entities whose concatenated metadata values (INTs casted as string) exceed a threshold in characters. More... | |
Protected Member Functions | |
getIgnoreAccess () | |
Get the ignore access value. More... | |
Protected Attributes | |
$values = array() | |
$isSynchronized = array() | |
$ignoreAccess = null | |
Definition at line 11 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::clear | ( | $entity_guid | ) |
Forget about all metadata for an entity.
int | $entity_guid | The GUID of the entity |
Definition at line 183 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::filterMetadataHeavyEntities | ( | array | $guids, |
$limit = 1024000 |
|||
) |
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.
array | $guids | GUIDs of entities to examine |
int | $limit | Limit in characters of all metadata (with ints casted to strings) |
Definition at line 334 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::flush | ( | ) |
Clear entire cache and mark all entities as out of sync.
Definition at line 193 of file ElggVolatileMetadataCache.php.
|
protected |
Get the ignore access value.
Definition at line 225 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::invalidateByOptions | ( | $action, | |
array | $options | ||
) |
Invalidate based on options passed to the global *_metadata functions.
string | $action | Action performed on metadata. "delete", "disable", or "enable" |
array | $options | Options passed to elgg_(delete|disable|enable)_metadata "guid" if given, invalidation will be limited to this entity "metadata_name" if given, invalidation will be limited to metadata with this name |
Definition at line 242 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::isKnown | ( | $entity_guid, | |
$name | |||
) |
If true, load() will return an accurate value for this name.
int | $entity_guid | The GUID of the entity |
string | $name | The metadata name |
Definition at line 157 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::isSynchronized | ( | $entity_guid | ) |
Have all the metadata for this entity been cached?
int | $entity_guid | The GUID of the entity |
Definition at line 80 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::load | ( | $entity_guid, | |
$name | |||
) |
Warning: You should always call isKnown() beforehand to verify that this function's return value should be trusted (otherwise a null return value is ambiguous).
int | $entity_guid | The GUID of the entity |
string | $name | The metadata name |
Definition at line 129 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::loadAll | ( | $entity_guid | ) |
Get the metadata for an entity.
int | $entity_guid | The GUID of the entity |
Definition at line 55 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::markEmpty | ( | $entity_guid, | |
$name | |||
) |
Declare that metadata under this name is known to be not fetch-able from storage.
int | $entity_guid | The GUID of the entity |
string | $name | The metadata name |
Definition at line 173 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::markOutOfSync | ( | $entity_guid | ) |
Declare that there may be fetch-able metadata names in storage that this cache doesn't know about.
int | $entity_guid | The GUID of the entity |
Definition at line 70 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::markUnknown | ( | $entity_guid, | |
$name | |||
) |
Forget about this metadata entry.
We don't want to try to guess what the next fetch from storage will return
int | $entity_guid | The GUID of the entity |
string | $name | The metadata name |
Definition at line 145 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::populateFromEntities | ( | $guids | ) |
Populate the cache from a set of entities.
int | array | $guids | Array of or single GUIDs |
Definition at line 269 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::save | ( | $entity_guid, | |
$name, | |||
$value, | |||
$allow_multiple = false |
|||
) |
Cache a piece of metadata.
int | $entity_guid | The GUID of the entity |
string | $name | The metadata name |
array | int | string | null | $value | The metadata value. null means it is known that there is no fetch-able metadata under this name |
bool | $allow_multiple | Can the metadata be an array |
Definition at line 95 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::saveAll | ( | $entity_guid, | |
array | $values | ||
) |
Cache metadata for an entity.
int | $entity_guid | The GUID of the entity |
array | $values | The metadata values to cache |
Definition at line 42 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::setIgnoreAccess | ( | $ignore | ) |
Use this value instead of calling elgg_get_ignore_access().
By default that function will be called.
This setting makes this component a little more loosely-coupled.
bool | $ignore | Whether to ignore access or not |
Definition at line 207 of file ElggVolatileMetadataCache.php.
ElggVolatileMetadataCache::unsetIgnoreAccess | ( | ) |
Tell the cache to call elgg_get_ignore_access() to determing access status.
Definition at line 216 of file ElggVolatileMetadataCache.php.
|
protected |
Definition at line 33 of file ElggVolatileMetadataCache.php.
|
protected |
Definition at line 28 of file ElggVolatileMetadataCache.php.
|
protected |
Definition at line 20 of file ElggVolatileMetadataCache.php.