getExtra(key)
Returns extra (for given object for given key).
Arguments
key(string): Key to get an extra by.
Lifecycle
preGetExtra
Event name:
preGetExtraProperties passed:cacheInstancereference to cache instance (this)keykey passed togetExtramethod
Returns: (object): object containing properties:
cacheInstancereference to cache instance (this)keykey passed through handlers added forpreGetExtraevent
postGetExtra
Event name:
postGetExtraProperties passed:cacheInstancereference to cache instance (this) returned bypreGetExtrakeykey returned bypreGetExtraextraextra (object) returned by adapter using its getExtra method
Returns: (object): object containing properties:
cacheInstancereference to cache instance (this)keykey passed through handlers added forpostGetExtraeventextraextra passed through handlers added forpostGetExtraevent
Eventually
getExtrareturns extra returned bypostGetExtra.
Returns
(object): Object, extra from item.
(undefined): If item is not found (thus no extra can be taken from it), returns undefined.
Example
// assuming that you already have cache instance prepared
cache.getExtra('key'); // object, extra for that item
cache.getExtra('keyForItemThatDoesNotExist'); // undefinedLast updated