public function isChild($id) { foreach ($this->children as $childId => $child) { if ($id == $childId) { return true; } } return false; }