| 1 | <?php |
||
| 15 | class Aggregate extends Literal { |
||
| 16 | const AVG = 'avg'; |
||
| 17 | const COUNT = 'count'; |
||
| 18 | const COUNT_DISTINCT = 'count-distinct'; |
||
| 19 | const MAX = 'max'; |
||
| 20 | const MIN = 'min'; |
||
| 21 | const SUM = 'sum'; |
||
| 22 | |||
| 23 | private $func; |
||
| 24 | private $column; |
||
| 25 | private $alias; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Construct an {@link Aggregate} object. |
||
| 29 | * |
||
| 30 | * @param string $func The name of the aggregate function. Use one of the **Aggregate::*** constants. |
||
| 31 | * @param string $column The name of the column to aggregate. |
||
| 32 | * @param string $alias The alias of the aggregate. If left out then the function name will be used as the alias. |
||
| 33 | */ |
||
| 34 | 2 | public function __construct($func, $column, $alias = '') { |
|
| 47 | |||
| 48 | /** |
||
| 49 | * {@inheritdoc} |
||
| 50 | */ |
||
| 51 | 2 | public function getValue(Db $db, ...$args) { |
|
| 59 | } |
||
| 60 |