PHP Class Neos\ContentRepository\Domain\Utility\NodePaths

Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Méthodes publiques

Méthode Description
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 ".

Method Details

addNodePathSegment() public static méthode

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.
Résultat string

explodeContextPath() public static méthode

Splits the given context path into relevant information, which results in an array with keys: "nodePath", "workspaceName", "dimensions"
See also: generateContextPath()
public static explodeContextPath ( string $contextPath ) : array
$contextPath string a context path including workspace and/or dimension information.
Résultat array split information from the context path

generateContextPath() public static méthode

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
Résultat string

generateRandomNodeName() public static méthode

Generates a simple random node name.
public static generateRandomNodeName ( ) : string
Résultat string

getNodeNameFromPath() public static méthode

Get the name for a Node based on the given path.
public static getNodeNameFromPath ( string $path ) : string
$path string
Résultat string

getParentPath() public static méthode

Get the parent path of the given Node path.
public static getParentPath ( string $path ) : string
$path string
Résultat string

getPathDepth() public static méthode

The root node "/" has depth 0, for every segment 1 is added.
public static getPathDepth ( string $path ) : integer
$path string
Résultat integer

getRelativePathBetween() public static méthode

Example with "/foo" and "/foo/bar/baz" will return "bar/baz".
public static getRelativePathBetween ( string $parentPath, string $subPath ) : string
$parentPath string
$subPath string
Résultat string

isContextPath() public static méthode

Determine if the given node path is a context path.
public static isContextPath ( string $contextPath ) : boolean
$contextPath string
Résultat boolean

isSubPathOf() public static méthode

Does $possibleSubPath begin with $path and so is a subpath or not.
public static isSubPathOf ( string $path, string $possibleSubPath ) : boolean
$path string
$possibleSubPath string
Résultat boolean

normalizePath() public static méthode

You should usually use \Neos\ContentRepository\Domain\Service\NodeService::normalizePath() because functionality could be overloaded, this is here only for low level operations.
See also: Neos\ContentRepository\Domain\Service\NodeService::normalizePath()
public static normalizePath ( $path, string $referencePath = null ) : string
$path
$referencePath string
Résultat string

parseDimensionValueStringToArray() public static méthode

public static parseDimensionValueStringToArray ( string $dimensionValueString ) : array
$dimensionValueString string
Résultat array

replaceRelativePathElements() public static méthode

.") in a given path
public static replaceRelativePathElements ( string $path ) : string
$path string absolute node path with relative path elements ("." or "..").
Résultat string