PHP Класс Neos\ContentRepository\Domain\Utility\NodePaths

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addNodePathSegment ( string $nodePath, string $nodePathSegment ) : string Appends the given $nodePathSegment to the $nodePath
explodeContextPath ( string $contextPath ) : array Splits the given context path into relevant information, which results in an array with keys: "nodePath", "workspaceName", "dimensions"
generateContextPath ( string $path, string $workspaceName, array $dimensionValues = [] ) : string Returns the given absolute node path appended with additional context information (such as the workspace name and dimensions).
generateRandomNodeName ( ) : string Generates a simple random node name.
getNodeNameFromPath ( string $path ) : string Get the name for a Node based on the given path.
getParentPath ( string $path ) : string Get the parent path of the given Node path.
getPathDepth ( string $path ) : integer Returns the depth of the given Node path.
getRelativePathBetween ( string $parentPath, string $subPath ) : string Get the relative path between the given $parentPath and the given $subPath.
isContextPath ( string $contextPath ) : boolean Determine if the given node path is a context path.
isSubPathOf ( string $path, string $possibleSubPath ) : boolean Does $possibleSubPath begin with $path and so is a subpath or not.
normalizePath ( $path, string $referencePath = null ) : string Normalizes the given node path to a reference path and returns an absolute path.
parseDimensionValueStringToArray ( string $dimensionValueString ) : array
replaceRelativePathElements ( string $path ) : string Replaces relative path segments ("." or ".

Описание методов

addNodePathSegment() публичный статический Метод

Appends the given $nodePathSegment to the $nodePath
public static addNodePathSegment ( string $nodePath, string $nodePathSegment ) : string
$nodePath string Absolute node path
$nodePathSegment string Usually a nodeName but could also be a relative node path.
Результат string

explodeContextPath() публичный статический Метод

Splits the given context path into relevant information, which results in an array with keys: "nodePath", "workspaceName", "dimensions"
См. также: generateContextPath()
public static explodeContextPath ( string $contextPath ) : array
$contextPath string a context path including workspace and/or dimension information.
Результат array split information from the context path

generateContextPath() публичный статический Метод

Returns the given absolute node path appended with additional context information (such as the workspace name and dimensions).
public static generateContextPath ( string $path, string $workspaceName, array $dimensionValues = [] ) : string
$path string absolute node path
$workspaceName string
$dimensionValues array
Результат string

generateRandomNodeName() публичный статический Метод

Generates a simple random node name.
public static generateRandomNodeName ( ) : string
Результат string

getNodeNameFromPath() публичный статический Метод

Get the name for a Node based on the given path.
public static getNodeNameFromPath ( string $path ) : string
$path string
Результат string

getParentPath() публичный статический Метод

Get the parent path of the given Node path.
public static getParentPath ( string $path ) : string
$path string
Результат string

getPathDepth() публичный статический Метод

The root node "/" has depth 0, for every segment 1 is added.
public static getPathDepth ( string $path ) : integer
$path string
Результат integer

getRelativePathBetween() публичный статический Метод

Example with "/foo" and "/foo/bar/baz" will return "bar/baz".
public static getRelativePathBetween ( string $parentPath, string $subPath ) : string
$parentPath string
$subPath string
Результат string

isContextPath() публичный статический Метод

Determine if the given node path is a context path.
public static isContextPath ( string $contextPath ) : boolean
$contextPath string
Результат boolean

isSubPathOf() публичный статический Метод

Does $possibleSubPath begin with $path and so is a subpath or not.
public static isSubPathOf ( string $path, string $possibleSubPath ) : boolean
$path string
$possibleSubPath string
Результат boolean

normalizePath() публичный статический Метод

You should usually use \Neos\ContentRepository\Domain\Service\NodeService::normalizePath() because functionality could be overloaded, this is here only for low level operations.
См. также: Neos\ContentRepository\Domain\Service\NodeService::normalizePath()
public static normalizePath ( $path, string $referencePath = null ) : string
$path
$referencePath string
Результат string

parseDimensionValueStringToArray() публичный статический Метод

public static parseDimensionValueStringToArray ( string $dimensionValueString ) : array
$dimensionValueString string
Результат array

replaceRelativePathElements() публичный статический Метод

.") in a given path
public static replaceRelativePathElements ( string $path ) : string
$path string absolute node path with relative path elements ("." or "..").
Результат string