How can I count an entity\'s items with a condition in Doctrine? For example, I realize that I can use:
$usersCount = $dm->getRepository(\'User\')->count()
Since doctrine 2.6 you can just count the result of the provided conditions when you don't really need the data:
$usersCount = $dm->getRepository('User')->count(array('type' => 'employee'));
Upgrade to 2.6