Jackalope\Transport\DoctrineDBAL\Client::getNodePathForIdentifier PHP Method

getNodePathForIdentifier() public method

{@inheritDoc}
public getNodePathForIdentifier ( $uuid, $workspace = null )
    public function getNodePathForIdentifier($uuid, $workspace = null)
    {
        if (null !== $workspace) {
            throw new NotImplementedException('Specifying the workspace is not yet supported.');
        }
        $this->assertLoggedIn();
        $query = "SELECT path FROM phpcr_nodes WHERE identifier = ? AND workspace_name = ?";
        $path = $this->getConnection()->fetchColumn($query, array($uuid, $this->workspaceName));
        if (!$path) {
            throw new ItemNotFoundException("no item found with uuid " . $uuid);
        }
        return $path;
    }

Usage Example

 /**
  * {@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;
 }
All Usage Examples Of Jackalope\Transport\DoctrineDBAL\Client::getNodePathForIdentifier