public function getNodePathForIdentifier($uuid, $workspace = null)
{
if (empty($this->caches['nodes']) || null !== $workspace) {
return parent::getNodePathForIdentifier($uuid);
}
$this->assertLoggedIn();
$cacheKey = "nodes by uuid: {$uuid}, " . $this->workspaceName;
$cacheKey = $this->sanitizeKey($cacheKey);
if (false !== ($result = $this->caches['nodes']->fetch($cacheKey))) {
if ('ItemNotFoundException' === $result) {
throw new ItemNotFoundException("no item found with uuid " . $uuid);
}
return $result;
}
try {
$path = parent::getNodePathForIdentifier($uuid);
} catch (ItemNotFoundException $e) {
if (isset($this->caches['nodes'])) {
$this->caches['nodes']->save($cacheKey, 'ItemNotFoundException');
}
throw $e;
}
$this->caches['nodes']->save($cacheKey, $path);
return $path;
}