id = $nodeData[$keys['id']]; $this->pid = $nodeData[$keys['pid']]; $this->left = $nodeData[$keys['left']]; $this->right = $nodeData[$keys['right']]; $this->level = $nodeData[$keys['level']]; $this->data = $nodeData; $a = $this->right - $this->left; if ($a > 1) { $this->hasChild = true; $this->numChild = ($a - 1) / 2; } return $this; } /** * @param string $name * @return null|array * * @deprecated 102.0.0 */ public function getData($name) { if (isset($this->data[$name])) { return $this->data[$name]; } else { return null; } } /** * @return int * * @deprecated 102.0.0 */ public function getLevel() { return $this->level; } /** * @return int * * @deprecated 102.0.0 */ public function getLeft() { return $this->left; } /** * @return int * * @deprecated 102.0.0 */ public function getRight() { return $this->right; } /** * @return string|int * * @deprecated 102.0.0 */ public function getPid() { return $this->pid; } /** * @return string|int * * @deprecated 102.0.0 */ public function getId() { return $this->id; } /** * Return true if node has child * * @return bool * * @deprecated 102.0.0 */ public function isParent() { if ($this->right - $this->left > 1) { return true; } else { return false; } } }