Neos\ContentRepository\Domain\Utility\NodePaths::generateContextPath PHP Method

generateContextPath() public static method

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
return string
    public static function generateContextPath($path, $workspaceName, array $dimensionValues = array())
    {
        $contextPath = $path;
        $contextPath .= '@' . $workspaceName;
        if ($dimensionValues !== array()) {
            $contextPath .= ';';
            foreach ($dimensionValues as $dimensionName => $innerDimensionValues) {
                $contextPath .= $dimensionName . '=' . implode(',', $innerDimensionValues) . '&';
            }
            $contextPath = substr($contextPath, 0, -1);
        }
        return $contextPath;
    }

Usage Example

コード例 #1
0
 /**
  * Returns the absolute path of this node with additional context information (such as the workspace name).
  *
  * Example: /sites/mysitecom/homepage/about@user-admin
  *
  * @return string Node path with context information
  */
 public function getContextPath()
 {
     return NodePaths::generateContextPath($this->path, $this->workspace->getName(), $this->getDimensionValues());
 }
All Usage Examples Of Neos\ContentRepository\Domain\Utility\NodePaths::generateContextPath