private function selectExistCat($id) { $db = new Application_Model_DbTable_Categories(); $cat = $db->getCategoryById($id); $res = true; $prods = 0; if (count($cat) > 0) { $cat = $cat[0]['children']; $db2 = new Application_Model_DbTable_Products(); $prods = $db2->cntProductsInChilds($cat); if ($prods == 0) { $res = false; } } else { $res = false; } return $res; }