public function setChildren($children) { $this->childs = $children; if (is_array($children) and count($children > 0)) { $this->hasChilds = true; } else { $this->hasChilds = false; } return $this; }