getParent(); while ($parent != null) { $index = $parent->getIndex($cell); $result = $index . mxCellPath::$PATH_SEPARATOR . $result; $cell = $parent; $parent = $cell->getParent(); } return (strlen($result) > 1) ? substr($result, 0, strlen($result) - 1) : ""; } /** * Function: getParentPath * * Returns the cell for the specified cell path using the given root as the * root of the path. * * Parameters: * * path - Path whose parent path should be returned. */ static function getParentPath($path) { if ($path != null && strlen($path) > 0) { $index = strrpos($path, mxCellPath::$PATH_SEPARATOR); if ($index === false) { return ""; } else { return substr($path, 0, $index); } } return null; } /** * Function: resolve * * Returns the cell for the specified cell path using the given root as the * root of the path. * * Parameters: * * root - Root cell of the path to be resolved. * path - String that defines the path. */ static function resolve($root, $path) { $parent = $root; $tokens = explode(mxCellPath::$PATH_SEPARATOR, $path); for ($i=0; $igetChildAt($tokens[$i]); } return $parent; } } ?>