1 | <?php |
||
19 | abstract class AbstractHandler |
||
20 | { |
||
21 | /** |
||
22 | * @var \Symfony\Component\Cache\Adapter\TagAwareAdapterInterface |
||
23 | */ |
||
24 | protected $cache; |
||
25 | |||
26 | /** |
||
27 | * @var \eZ\Publish\SPI\Persistence\Handler |
||
28 | */ |
||
29 | protected $persistenceHandler; |
||
30 | |||
31 | /** |
||
32 | * @var \eZ\Publish\Core\Persistence\Cache\PersistenceLogger |
||
33 | */ |
||
34 | protected $logger; |
||
35 | |||
36 | /** |
||
37 | * Setups current handler with everything needed. |
||
38 | * |
||
39 | * @param \Symfony\Component\Cache\Adapter\TagAwareAdapterInterface $cache |
||
40 | * @param \eZ\Publish\SPI\Persistence\Handler $persistenceHandler |
||
41 | * @param \eZ\Publish\Core\Persistence\Cache\PersistenceLogger $logger |
||
42 | */ |
||
43 | public function __construct( |
||
52 | |||
53 | /** |
||
54 | * Helper for getting multiple cache items in one call and do the id extraction for you. |
||
55 | * |
||
56 | * Cache items must be stored with a key in the following format "${keyPrefix}${id}", like "ez-content-info-${id}", |
||
57 | * in order for this method to be able to prefix key on id's and also extract key prefix afterwards. |
||
58 | * |
||
59 | * It also optionally supports a key suffix, for use on a variable argument that affects all lookups, |
||
60 | * like translations, i.e. "ez-content-${id}-${translationKey}" where $keySuffix = "-${translationKey}". |
||
61 | * |
||
62 | * @param array $ids |
||
63 | * @param string $keyPrefix E.g "ez-content-" |
||
64 | * @param callable $missingLoader Function for loading missing objects, gets array with missing id's as argument, |
||
65 | * expects return value to be array with id as key. Missing items should be missing. |
||
66 | * @param callable $loadedTagger Function for tagging loaded object, gets object as argument, return array of tags. |
||
67 | * @param array $keySuffixes Optional, key is id as provided in $ids, and value is a key suffix e.g. "-eng-Gb" |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | final protected function getMultipleCacheItems( |
||
128 | } |
||
129 |