public function getSubTree(\ORC\Util\Tree\INode $node) { $tree = new self($node); $childrenKeys = $this->getAllChildrenKeys($node->getKey()); foreach ($childrenKeys as $key) { $child = $this->get($key); $tree->addByKey($child, $this->parentKeys[$key]); } return $tree; }