/** * Clears cache of pages where an object with the given identifier is shown * * @param string $objectIdentifier */ public function clearPageCacheForObjectIdentifier($objectIdentifier) { // TODO: Move this to different implementations of the Tracking Manager... switch ($this->extensionConfiguration->getCacheInvalidationLevel()) { case 'consistent': $sharedLock = null; $sharedLockAcquired = $this->acquireLock($sharedLock, $objectIdentifier, FALSE); if ($sharedLockAcquired) { if ($this->trackingCache->has($objectIdentifier)) { $exclusiveLock = null; $exclusiveLockAcquired = $this->acquireLock($exclusiveLock, $objectIdentifier . '-e', TRUE); if ($exclusiveLockAcquired) { $pageHashs = $this->trackingCache->get($objectIdentifier); $this->pageCacheFacade->flushCacheByHashIdentifiers($pageHashs); $this->trackingCache->set($objectIdentifier, array()); $this->releaseLock($exclusiveLock); } else { $pageHashs = $this->trackingCache->get($objectIdentifier); $this->pageCacheFacade->flushCacheByHashIdentifiers($pageHashs); } } $this->releaseLock($sharedLock); } else { // Failed locking // should probably throw an exception here } break; default: case 'noinvalidation': break; } return; }