If count()
isn't working then you can try something like this.
public function getCountDetail($role)
{
$q = Doctrine_Query::create()
->from('[some table] a')
->where('a.role = ?', $role)
->select('COUNT(a.id)')
->execute(array(),Doctrine_Core::HYDRATE_SINGLE_SCALAR)
return $q;
}
In this case the function will return a single number representing the number of records found.