ErrorException [ Warning ]: count(): Parameter must be an array or an object that implements Countable

APPPATH/classes/Model/Poll.php [ 14 ]

 9         if (!$result = Cache::instance()->get("vote_articles_{$lang}_{$offset}_{$limit}")) {
10             $result = array();
11 
12             $num = DB::query(Database::SELECT, "SELECT COUNT(*) as cnt FROM fm_polls WHERE state = 1 AND in_{$lang} = TRUE")->execute()->get('cnt', 0);
13 
14             if (count($num) > 0) {
15                 $rows = DB::query(Database::SELECT, "SELECT p.title_{$lang} as \"title\", p.fulltext_{$lang} as \"text\", p.id, p.input_type,"
16                                 . " (SELECT SUM(o.cnt) FROM fm_polls_options o WHERE o.poll_id = p.id) AS total_cnt "
17                                 . "FROM fm_polls p "
18                                 . "WHERE p.state = 1 AND p.in_{$lang} = TRUE "
19                                 . "ORDER BY p.pub_date DESC "
  1. APPPATH/classes/Model/Poll.php [ 14 ] » Kohana_Core::error_handler()

  2. APPPATH/classes/Controller/Voting.php [ 26 ] » Model_Poll->get_poll_articles()

  3. SYSPATH/classes/Kohana/Controller.php [ 84 ] » Controller_Voting->action_index()

  4. {PHP internal call} » Kohana_Controller->execute()

  5. SYSPATH/classes/Kohana/Request/Client/Internal.php [ 94 ] » ReflectionMethod->invoke()

  6. SYSPATH/classes/Kohana/Request/Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request()

  7. SYSPATH/classes/Kohana/Request.php [ 1000 ] » Kohana_Request_Client->execute()

  8. DOCROOT/index.php [ 138 ] » Kohana_Request->execute()

Environment