Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler Class Reference

Abstract handler for use in other SPI Handlers. More...

Inheritance diagram for eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler:

## Public Member Functions
| __construct (TransactionAwareAdapterInterface $cache, PersistenceLogger $logger, InMemoryCache $inMemory)
| Setups current handler with everything needed. More...

## Protected Member Functions
| getCacheValue ( $id, string $keyPrefix, callable $backendLoader, callable $cacheTagger, callable $cacheIndexes, string $keySuffix='', array $arguments=[])
| Load one cache item from cache and loggs the hits / misses. More...
| getListCacheValue (string $key, callable $backendLoader, callable $cacheTagger, callable $cacheIndexes, callable $listTags=null, array $arguments=[])
| Load list of objects of some type and loggs the hits / misses. More...
| getMultipleCacheValues (array $ids, string $keyPrefix, callable $backendLoader, callable $cacheTagger, callable $cacheIndexes, string $keySuffix='', array $arguments=[])
| Load several cache items from cache and loggs the hits / misses. More...

## Protected Attributes
| $cache
| $logger

## Private Attributes
| $inMemory

## Detailed Description

Abstract handler for use in other SPI Handlers.

Can be used in external handlers, but be aware this should be regarded as experimental feature. As in, method signatures and behaviour might change in the future.

Definition at line 18 of file AbstractInMemoryHandler.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::__construct | ( | TransactionAwareAdapterInterface | $cache,
|  | PersistenceLogger | $logger,
|  | InMemoryCache | $inMemory
| ) |  |

Setups current handler with everything needed.

Parameters

  \eZ\Publish\Core\Persistence\Cache\Adapter\TransactionAwareAdapterInterface | $cache |
  \eZ\Publish\Core\Persistence\Cache\PersistenceLogger | $logger |
  \eZ\Publish\Core\Persistence\Cache\InMemory\InMemoryCache | $inMemory |

Definition at line 45 of file AbstractInMemoryHandler.php.

References eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\$cache, eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\$inMemory, and eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\$logger.

## Member Function Documentation

## ◆ getCacheValue()

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::getCacheValue | ( |  | $id,
|  | string | $keyPrefix,
|  | callable | $backendLoader,
|  | callable | $cacheTagger,
|  | callable | $cacheIndexes,
|  | string | $keySuffix = `''`,
|  | array | $arguments = `[]`
| ) |  |
| final protected

Load one cache item from cache and loggs the hits / misses.

Load items from in-memory cache, symfony cache pool or backend in that order. If not cached the returned objects will be placed in cache.

Parameters

  int | string | $id |
  string | $keyPrefix | E.g "ez-content-"
  callable | $backendLoader | Function for loading missing objects, gets array with missing id's as argument, expects return value to be array with id as key. Missing items should be missing.
  callable | $cacheTagger | Gets cache object as argument, return array of cache tags.
  callable | $cacheIndexes | Gets cache object as argument, return array of cache keys.
  string | $keySuffix | Optional, e.g "-by-identifier"

Returns
  object

Definition at line 71 of file AbstractInMemoryHandler.php.

Referenced by eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\getContentState(), eZ\Publish\Core\Persistence\Cache\UserPreferenceHandler\getUserPreferenceByUserIdAndName(), eZ\Publish\Core\Persistence\Cache\ContentHandler\load(), eZ\Publish\Core\Persistence\Cache\ContentLanguageHandler\load(), eZ\Publish\Core\Persistence\Cache\LocationHandler\load(), eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\load(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\load(), eZ\Publish\Core\Persistence\Cache\UserHandler\load(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadByIdentifier(), eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\loadByIdentifier(), eZ\Publish\Core\Persistence\Cache\ContentLanguageHandler\loadByLanguageCode(), eZ\Publish\Core\Persistence\Cache\UserHandler\loadByLogin(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadByRemoteId(), eZ\Publish\Core\Persistence\Cache\LocationHandler\loadByRemoteId(), eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentInfo(), eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentInfoByRemoteId(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadGroup(), eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\loadGroup(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadGroupByIdentifier(), eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\loadGroupByIdentifier(), eZ\Publish\Core\Persistence\Cache\LocationHandler\loadLocationsByContent(), eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\loadObjectStates(), eZ\Publish\Core\Persistence\Cache\LocationHandler\loadParentLocationsForDraftContent(), eZ\Publish\Core\Persistence\Cache\UserHandler\loadRole(), eZ\Publish\Core\Persistence\Cache\UserHandler\loadRoleAssignment(), eZ\Publish\Core\Persistence\Cache\UserHandler\loadRoleByIdentifier(), eZ\Publish\Core\Persistence\Cache\LocationHandler\loadSubtreeIds(), and eZ\Publish\Core\Persistence\Cache\UserHandler\loadUserByToken().

## ◆ getListCacheValue()

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::getListCacheValue | ( | string | $key,
|  | callable | $backendLoader,
|  | callable | $cacheTagger,
|  | callable | $cacheIndexes,
|  | callable | $listTags = `null`,
|  | array | $arguments = `[]`
| ) |  |
| final protected

Load list of objects of some type and loggs the hits / misses.

Load items from in-memory cache, symfony cache pool or backend in that order. If not cached the returned objects will be placed in cache.

Parameters

  string | $key |
  callable | $backendLoader | Function for loading ALL objects, value is cached as-is.
  callable | $cacheTagger | Gets cache object as argument, return array of cache tags.
  callable | $cacheIndexes | Gets cache object as argument, return array of cache keys.
  callable | $listTags | Optional, global tags for the list cache.
  array | $arguments | Optional, arguments when parnt method takes arguments that key varies on.

Returns
  array

Definition at line 127 of file AbstractInMemoryHandler.php.

Referenced by eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\getSearchableFieldMap(), eZ\Publish\Core\Persistence\Cache\UrlAliasHandler\listURLAliasesForLocation(), eZ\Publish\Core\Persistence\Cache\ContentLanguageHandler\loadAll(), eZ\Publish\Core\Persistence\Cache\ObjectStateHandler\loadAllGroups(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadAllGroups(), eZ\Publish\Core\Persistence\Cache\UserHandler\loadByEmail(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadContentTypes(), eZ\Publish\Core\Persistence\Cache\UserHandler\loadRoleAssignmentsByGroupId(), and eZ\Publish\Core\Persistence\Cache\UserHandler\loadRoleAssignmentsByRoleId().

## ◆ getMultipleCacheValues()

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::getMultipleCacheValues | ( | array | $ids,
|  | string | $keyPrefix,
|  | callable | $backendLoader,
|  | callable | $cacheTagger,
|  | callable | $cacheIndexes,
|  | string | $keySuffix = `''`,
|  | array | $arguments = `[]`
| ) |  |
| final protected

Load several cache items from cache and loggs the hits / misses.

Load items from in-memory cache, symfony cache pool or backend in that order. If not cached the returned objects will be placed in cache.

Cache items must be stored with a key in the following format "${keyPrefix}${id}", like "ez-content-info-${id}", in order for this method to be able to prefix key on id's and also extract key prefix afterwards.

Parameters

  array | $ids |
  string | $keyPrefix | E.g "ez-content-"
  callable | $backendLoader | Function for loading missing objects, gets array with missing id's as argument, expects return value to be array with id as key. Missing items should be missing.
  callable | $cacheTagger | Gets cache object as argument, return array of cache tags.
  callable | $cacheIndexes | Gets cache object as argument, return array of cache keys.
  string | $keySuffix | Optional, e.g "-by-identifier"

Returns
  array

Definition at line 195 of file AbstractInMemoryHandler.php.

Referenced by eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentInfoList(), eZ\Publish\Core\Persistence\Cache\ContentHandler\loadContentList(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadContentTypeList(), eZ\Publish\Core\Persistence\Cache\ContentTypeHandler\loadGroups(), eZ\Publish\Core\Persistence\Cache\ContentLanguageHandler\loadList(), eZ\Publish\Core\Persistence\Cache\LocationHandler\loadList(), and eZ\Publish\Core\Persistence\Cache\ContentLanguageHandler\loadListByLanguageCodes().

## Member Data Documentation

## ◆ $cache

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::$cache
| protected

Definition at line 25 of file AbstractInMemoryHandler.php.

Referenced by eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\__construct(), and eZ\Publish\Core\Persistence\Cache\AbstractInMemoryPersistenceHandler\__construct().

## ◆ $inMemory

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::$inMemory
| private

Definition at line 36 of file AbstractInMemoryHandler.php.

Referenced by eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\__construct(), and eZ\Publish\Core\Persistence\Cache\AbstractInMemoryPersistenceHandler\__construct().

## ◆ $logger

eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler::$logger
| protected

Definition at line 28 of file AbstractInMemoryHandler.php.

Referenced by eZ\Publish\Core\Persistence\Cache\AbstractInMemoryHandler\__construct(), and eZ\Publish\Core\Persistence\Cache\AbstractInMemoryPersistenceHandler\__construct().

The documentation for this class was generated from the following file:

- AbstractInMemoryHandler.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.