public function hasChildren($CategoryID) { $ChildData = $this->SQL->select('CategoryID')->from('Category')->where('ParentCategoryID', $CategoryID)->get(); return $ChildData->numRows() > 0 ? true : false; }