| @@ 43-63 (lines=21) @@ | ||
| 40 | /** |
|
| 41 | * {@inheritdoc} |
|
| 42 | */ |
|
| 43 | public function loadSubtreeIds($locationId) |
|
| 44 | { |
|
| 45 | $cacheItem = $this->cache->getItem("ez-location-subtree-${locationId}"); |
|
| 46 | if ($cacheItem->isHit()) { |
|
| 47 | return $cacheItem->get(); |
|
| 48 | } |
|
| 49 | ||
| 50 | $this->logger->logCall(__METHOD__, array('location' => $locationId)); |
|
| 51 | $locationIds = $this->persistenceHandler->locationHandler()->loadSubtreeIds($locationId); |
|
| 52 | ||
| 53 | $cacheItem->set($locationIds); |
|
| 54 | $cacheTags = ['location-'.$locationId, 'location-path-'.$locationId]; |
|
| 55 | foreach ($locationIds as $locationId) { |
|
| 56 | $cacheTags[] = 'location-'.$locationId; |
|
| 57 | $cacheTags[] = 'location-path-'.$locationId; |
|
| 58 | } |
|
| 59 | $cacheItem->tag($cacheTags); |
|
| 60 | $this->cache->save($cacheItem); |
|
| 61 | ||
| 62 | return $locationIds; |
|
| 63 | } |
|
| 64 | ||
| 65 | /** |
|
| 66 | * {@inheritdoc} |
|
| @@ 131-151 (lines=21) @@ | ||
| 128 | /** |
|
| 129 | * @see eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::listURLAliasesForLocation |
|
| 130 | */ |
|
| 131 | public function listURLAliasesForLocation($locationId, $custom = false) |
|
| 132 | { |
|
| 133 | ||
| 134 | $cacheItem = $this->cache->getItem('ez-urlAlias-location-list-'.$locationId.($custom ? '-custom' : '')); |
|
| 135 | if ($cacheItem->isHit()) { |
|
| 136 | return $cacheItem->get(); |
|
| 137 | } |
|
| 138 | ||
| 139 | $this->logger->logCall(__METHOD__, array('location' => $locationId, 'custom' => $custom)); |
|
| 140 | $urlAliases = $this->persistenceHandler->urlAliasHandler()->listURLAliasesForLocation($locationId, $custom); |
|
| 141 | ||
| 142 | $cacheItem->set($urlAliases); |
|
| 143 | $cacheTags = ['urlAlias-location-'.$locationId]; |
|
| 144 | foreach ($urlAliases as $urlAlias) { |
|
| 145 | $cacheTags[] = 'urlAlias-'.$urlAlias->id; |
|
| 146 | } |
|
| 147 | $cacheItem->tag($cacheTags); |
|
| 148 | $this->cache->save($cacheItem); |
|
| 149 | ||
| 150 | return $urlAliases; |
|
| 151 | } |
|
| 152 | ||
| 153 | /** |
|
| 154 | * @see eZ\Publish\SPI\Persistence\Content\UrlAlias\Handler::removeURLAliases |
|