I am using fatfree framework with the cortex ORM plugin. I am trying to get the number of records matching a specific criteria. My code:
$group_qry = new \models\system\UserGroup;
$group_qry->load(array('type=?',$name));
echo $group_qry->count(); //always returns 3, i.e total number of records in table
Initially I was thinking that this maybe because the filtering wasn't working and it always fetched everything, but that is not the case, cause I verified it with
while(!$group_qry->dry()){
echo '<br/>'.$group_qry->type;
$group_qry->next();
}
So how do I get the number of records actually loaded after filtering?