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; }
/** * 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()); }