getNodePathForIdentifier() public method

{@inheritDoc}
public getNodePathForIdentifier ( $uuid, $workspace = null )
 /**
  * {@inheritDoc}
  */
 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;
 }
Example #2
0
 /**
  * {@inheritDoc}
  */
 public function getNodePathForIdentifier($uuid, $workspace = null)
 {
     if (null !== $workspace) {
         throw new NotImplementedException('Specifying the workspace is not yet supported.');
     }
     $this->assertLoggedIn();
     $cacheKey = "nodes by uuid: {$uuid}, " . $this->workspaceName;
     if (isset($this->caches['nodes']) && false !== ($result = $this->caches['nodes']->fetch($cacheKey))) {
         return $result;
     }
     $path = parent::getNodePathForIdentifier($uuid);
     if (isset($this->caches['nodes'])) {
         $this->caches['nodes']->save($cacheKey, $path);
     }
     return $path;
 }