public static function getAllCount(){
$sql = "SELECT COUNT(Title) from ".self::$tablename." GROUP BY category_id";
$query = Executor::doit($sql);
return Model::many($query[0],new EventData());
}
FOREACH ---
foreach ($evcount as $c) {
}
print_r($evcount);
?>
RETORNO -----
Array
(
[0] => EventData Object
(
[name] =>
[lastname] =>
[email] =>
[category_id] => NULL
[password] =>
[created_at] => NOW()
[COUNT(Title)] => 4
)
[1] => EventData Object
(
[name] =>
[lastname] =>
[email] =>
[category_id] => NULL
[password] =>
[created_at] => NOW()
[COUNT(Title)] => 62
)
I want to echo echo by pulling COUNT(title)=>
But when I give the echo it gives this error
Call to undefined method EventData :: COUNT ()