getNodePathForIdentifier() public method

Get the node path from a JCR uuid. This is mainly useful for cross-workspace functionality like clone or updateFrom.
See also: getNodeByIdentifier
public getNodePathForIdentifier ( string $uuid, string $workspace = null ) : string
$uuid string the unique uuid to find the path of
$workspace string pass null to use the current workspace of this transport
return string Absolute path to the node (not the node itself!)
 /**
  * {@inheritDoc}
  */
 public function getNodePathForIdentifier($uuid, $workspace = null)
 {
     $this->logger->startCall(__FUNCTION__, func_get_args());
     $result = $this->transport->getNodePathForIdentifier($uuid, $workspace);
     $this->logger->stopCall();
     return $result;
 }
Example #2
0
 /**
  * Get the nodes identified by the given uuids or absolute paths.
  *
  * Note uuids/paths that cannot be found will be ignored
  *
  * @param array $identifiers uuid's or absolute paths
  * @param string $class optional class name for the factory
  *
  * @return ArrayIterator of NodeInterface of the specified nodes keyed by their path
  *
  * @throws RepositoryException if another error occurs.
  *
  * @see Session::getNodes()
  */
 public function getNodes($identifiers, $class = 'Node')
 {
     // TODO get paths for UUID's via a single query
     $paths = array();
     foreach ($identifiers as $key => $identifier) {
         if (UUIDHelper::isUUID($identifier)) {
             if (empty($this->objectsByUuid[$identifier])) {
                 try {
                     $paths[$key] = $this->transport->getNodePathForIdentifier($identifier);
                 } catch (ItemNotFoundException $e) {
                     // ignore
                 }
             } else {
                 $paths[$key] = $this->objectsByUuid[$identifier];
             }
         } else {
             $paths[$key] = $identifier;
         }
     }
     return $this->getNodesByPath($paths, $class);
 }