2021-04-10 01:33:40 +02:00
|
|
|
<?php
|
|
|
|
|
2022-11-18 18:06:46 +01:00
|
|
|
namespace Core\Driver\SQL\Expression;
|
2021-04-10 01:33:40 +02:00
|
|
|
|
2023-01-05 22:47:17 +01:00
|
|
|
use Core\Driver\SQL\SQL;
|
2021-04-10 01:33:40 +02:00
|
|
|
|
2023-01-05 22:47:17 +01:00
|
|
|
class Sum extends Alias {
|
2021-04-10 01:33:40 +02:00
|
|
|
|
2023-01-05 22:47:17 +01:00
|
|
|
public function __construct(mixed $value, string $alias) {
|
|
|
|
parent::__construct($value, $alias);
|
2021-04-10 01:33:40 +02:00
|
|
|
}
|
|
|
|
|
2023-01-05 22:47:17 +01:00
|
|
|
protected function addValue(SQL $sql, array &$params): string {
|
|
|
|
return "SUM(" . $sql->addValue($this->getValue(), $params) . ")";
|
|
|
|
}
|
2021-04-10 01:33:40 +02:00
|
|
|
}
|