pagination + sql expressions + frontend improvements
This commit is contained in:
28
Core/Driver/SQL/Expression/AbstractFunction.class.php
Normal file
28
Core/Driver/SQL/Expression/AbstractFunction.class.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
use Core\Driver\SQL\SQL;
|
||||
|
||||
abstract class AbstractFunction extends Expression {
|
||||
|
||||
private string $functionName;
|
||||
private mixed $value;
|
||||
|
||||
public function __construct(string $functionName, mixed $value) {
|
||||
$this->functionName = $functionName;
|
||||
$this->value = $value;
|
||||
}
|
||||
|
||||
public function getExpression(SQL $sql, array &$params): string {
|
||||
return $this->functionName . "(" . $sql->addValue($this->getValue(), $params) . ")";
|
||||
}
|
||||
|
||||
public function getFunctionName(): string {
|
||||
return $this->functionName;
|
||||
}
|
||||
|
||||
public function getValue(): mixed {
|
||||
return $this->value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user