Esempio n. 1
0
 /**
  * Check if category is empty
  *
  * @param int $cat_id
  * @return bool
  */
 public function isCatEmpty($h, $cat_id = 0)
 {
     //print "isCatEmpty <br/>****<br/>******";
     //$posts = HotaruModels\Post::countByCategory($cat_id);
     $posts = \Hotaru\Models2\Post::countByCategory($h, $cat_id);
     //		$sql = "SELECT count(post_id) FROM " . TABLE_POSTS . " WHERE post_category = %d ";
     //		$posts = $h->db->get_var($h->db->prepare($sql, $cat_id));
     if ($posts == 0) {
         return true;
     } else {
         return false;
     }
 }