getNodeByIdentifier() public method

Get the node from a uuid. Same data format as getNode, but additionally must have the :jcr:path property.
public getNodeByIdentifier ( string $uuid ) : array
$uuid string the id in JCR format
return array associative array for the node (decoded from json with associative = true)
 /**
  * {@inheritDoc}
  */
 public function getNodeByIdentifier($uuid)
 {
     $this->logger->startCall(__FUNCTION__, func_get_args(), array('fetchDepth' => $this->transport->getFetchDepth()));
     $result = $this->transport->getNodeByIdentifier($uuid);
     $this->logger->stopCall();
     return $result;
 }
Example #2
0
 /**
  * Get the node identified by an uuid.
  *
  * @param string $identifier uuid
  * @param string $class      optional class name for factory
  *
  * @return NodeInterface The specified Node. if not available,
  *      ItemNotFoundException is thrown
  *
  * @throws ItemNotFoundException If the path was not found
  * @throws RepositoryException   if another error occurs.
  *
  * @see Session::getNodeByIdentifier()
  */
 public function getNodeByIdentifier($identifier, $class = 'Node')
 {
     if (empty($this->objectsByUuid[$identifier])) {
         $data = $this->transport->getNodeByIdentifier($identifier);
         $path = $data->{':jcr:path'};
         unset($data->{':jcr:path'});
         // TODO: $path is a backend path. we should inverse the getFetchPath operation here
         $node = $this->getNodeByPath($path, $class, $data);
         $this->objectsByUuid[$identifier] = $path;
         //only do this once the getNodeByPath has worked
         return $node;
     }
     return $this->getNodeByPath($this->objectsByUuid[$identifier], $class);
 }