Basic Components - Query - Aggregate functions.php 271 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php
$q = new Doctrine_Query();

$q->from('User(COUNT(id))');

// returns an array
$a = $q->execute();

// selecting multiple aggregate values:
$q = new Doctrine_Query();

$q->from('User(COUNT(id)).Phonenumber(MAX(phonenumber))');

$a = $q->execute();
?>