Overview

Packages

  • ClipIt
    • clipit
      • api
    • urjc
      • backend
  • Elgg
    • Core
      • Access
      • Authentication
      • Cache
      • Caches
      • Core
      • DataMode
        • Site
      • DataModel
        • Annotations
        • Entities
        • Extender
        • File
        • Importable
        • Loggable
        • Notable
        • Object
        • User
      • DataStorage
      • Exception
      • Exceptions
        • Stub
      • FileStore
        • Disk
      • Groups
      • Helpers
      • HMAC
      • Memcache
      • Metadata
      • Navigation
      • ODD
      • Output
      • Plugins
        • Settings
      • Sessions
      • SocialModel
        • Friendable
        • Locatable
      • WebServicesAPI
      • Widgets
      • XML
      • XMLRPC
    • Exceptions
      • Stub
  • None
  • PHP

Classes

  • ElggCache
  • ElggLRUCache
  • ElggSharedMemoryCache
  • ElggStaticVariableCache
  • ElggVolatileMetadataCache
  • Overview
  • Package
  • Class
  • Tree

Class ElggVolatileMetadataCache

ElggVolatileMetadataCache In memory cache of known metadata values stored by entity.

Package: Elgg\Core\Cache
Located at ElggVolatileMetadataCache.php
Methods summary
public
# saveAll( integer $entity_guid, array $values )

Cache metadata for an entity

Cache metadata for an entity

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
$values
array
$values The metadata values to cache
public array
# loadAll( integer $entity_guid )

Get the metadata for an entity

Get the metadata for an entity

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity

Returns

array
public
# markOutOfSync( integer $entity_guid )

Declare that there may be fetch-able metadata names in storage that this cache doesn't know about

Declare that there may be fetch-able metadata names in storage that this cache doesn't know about

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
public boolean
# isSynchronized( integer $entity_guid )

Have all the metadata for this entity been cached?

Have all the metadata for this entity been cached?

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity

Returns

boolean
public
# save( integer $entity_guid, string $name, array|integer|string|null $value, boolean $allow_multiple = false )

Cache a piece of metadata

Cache a piece of metadata

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
$name
string
$name The metadata name
$value
array|integer|string|null
$value The metadata value. null means it is known that there is no fetch-able metadata under this name
$allow_multiple
boolean
$allow_multiple Can the metadata be an array
public array|string|integer|null
# load( integer $entity_guid, string $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).

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).

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
$name
string
$name The metadata name

Returns

array|string|integer|null
null = value does not exist
public
# markUnknown( integer $entity_guid, string $name )

Forget about this metadata entry. We don't want to try to guess what the next fetch from storage will return

Forget about this metadata entry. We don't want to try to guess what the next fetch from storage will return

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
$name
string
$name The metadata name
public boolean
# isKnown( integer $entity_guid, string $name )

If true, load() will return an accurate value for this name

If true, load() will return an accurate value for this name

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
$name
string
$name The metadata name

Returns

boolean
public array
# markEmpty( integer $entity_guid, string $name )

Declare that metadata under this name is known to be not fetch-able from storage

Declare that metadata under this name is known to be not fetch-able from storage

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
$name
string
$name The metadata name

Returns

array
public
# clear( integer $entity_guid )

Forget about all metadata for an entity

Forget about all metadata for an entity

Parameters

$entity_guid
integer
$entity_guid The GUID of the entity
public
# flush( )

Clear entire cache and mark all entities as out of sync

Clear entire cache and mark all entities as out of sync

public
# setIgnoreAccess( boolean $ignore )

Use this value instead of calling elgg_get_ignore_access(). By default that function will be called.

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.

Parameters

$ignore
boolean
$ignore Whether to ignore access or not
public
# unsetIgnoreAccess( )

Tell the cache to call elgg_get_ignore_access() to determing access status.

Tell the cache to call elgg_get_ignore_access() to determing access status.

protected boolean
# getIgnoreAccess( )

Get the ignore access value

Get the ignore access value

Returns

boolean
public
# invalidateByOptions( string $action, array $options )

Invalidate based on options passed to the global *_metadata functions

Invalidate based on options passed to the global *_metadata functions

Parameters

$action
string
$action Action performed on metadata. "delete", "disable", or "enable"
$options
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
public
# populateFromEntities( integer|array $guids )

Populate the cache from a set of entities

Populate the cache from a set of entities

Parameters

$guids
integer|array
$guids Array of or single GUIDs
public array
# filterMetadataHeavyEntities( array $guids, integer $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.

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.

Parameters

$guids
array
$guids GUIDs of entities to examine
$limit
integer
$limit Limit in characters of all metadata (with ints casted to strings)

Returns

array
Properties summary
protected array $values array()
#

The cached values (or null for known to be empty). If the portion of the cache is synchronized, missing values are assumed to indicate that values do not exist in storage, otherwise, we don't know what's there.

The cached values (or null for known to be empty). If the portion of the cache is synchronized, missing values are assumed to indicate that values do not exist in storage, otherwise, we don't know what's there.

protected array $isSynchronized array()
#

Does the cache know that it contains all names fetch-able from storage? The keys are entity GUIDs and either the value exists (true) or it's not set.

Does the cache know that it contains all names fetch-able from storage? The keys are entity GUIDs and either the value exists (true) or it's not set.

protected null|boolean $ignoreAccess null
#
API documentation generated by ApiGen 2.8.0