/** * Returns this node's name. * * @param boolean $includeParent * @return string */ public function getName($includeParent = FALSE, $includeCommonPath = FALSE) { if ($includeParent && $this->parent !== NULL) { if (!isset($this->cache['nameIncludingParent'])) { $parent = $this->parent->getName(TRUE); $this->cache['nameIncludingParent'] = !empty($parent) ? $parent . '/' . $this->name : $this->name; } return $this->cache['nameIncludingParent']; } else { if ($this->parent !== NULL) { return $this->name; } else { return $includeCommonPath ? $this->name : ''; } } }