Neos\ContentRepository\Domain\Service\NodeServiceInterface::normalizePath PHP Method

normalizePath() public method

Normalizes the given node path to a reference path and returns an absolute path.
public normalizePath ( string $path, string $referencePath = null ) : string
$path string The non-normalized path
$referencePath string a reference path in case the given path is relative.
return string The normalized absolute path
    public function normalizePath($path, $referencePath = null);

Usage Example

コード例 #1
0
 /**
  * Returns a node specified by the given relative path.
  *
  * @param string $path Path specifying the node, relative to this node
  * @return NodeInterface The specified node or NULL if no such node exists
  * @api
  */
 public function getNode($path)
 {
     $absolutePath = $this->nodeService->normalizePath($path, $this->getPath());
     $node = $this->context->getFirstLevelNodeCache()->getByPath($absolutePath);
     if ($node !== false) {
         return $node;
     }
     $node = $this->nodeDataRepository->findOneByPathInContext($absolutePath, $this->context);
     $this->context->getFirstLevelNodeCache()->setByPath($absolutePath, $node);
     return $node;
 }