Namespace and ClassPath rewrites
This commit is contained in:
14
Core/Driver/SQL/Expression/Add.class.php
Normal file
14
Core/Driver/SQL/Expression/Add.class.php
Normal file
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
use Core\Driver\SQL\Condition\Compare;
|
||||
|
||||
# TODO: change confusing class inheritance here
|
||||
class Add extends Compare {
|
||||
|
||||
public function __construct(string $col, $val) {
|
||||
parent::__construct($col, $val, "+");
|
||||
}
|
||||
|
||||
}
|
||||
23
Core/Driver/SQL/Expression/CaseWhen.class.php
Normal file
23
Core/Driver/SQL/Expression/CaseWhen.class.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
use Core\Driver\SQL\Condition\Condition;
|
||||
|
||||
class CaseWhen extends Expression {
|
||||
|
||||
private Condition $condition;
|
||||
private $trueCase;
|
||||
private $falseCase;
|
||||
|
||||
public function __construct(Condition $condition, $trueCase, $falseCase) {
|
||||
$this->condition = $condition;
|
||||
$this->trueCase = $trueCase;
|
||||
$this->falseCase = $falseCase;
|
||||
}
|
||||
|
||||
public function getCondition(): Condition { return $this->condition; }
|
||||
public function getTrueCase() { return $this->trueCase; }
|
||||
public function getFalseCase() { return $this->falseCase; }
|
||||
|
||||
}
|
||||
7
Core/Driver/SQL/Expression/CurrentTimeStamp.class.php
Normal file
7
Core/Driver/SQL/Expression/CurrentTimeStamp.class.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
class CurrentTimeStamp extends Expression {
|
||||
|
||||
}
|
||||
23
Core/Driver/SQL/Expression/DateAdd.class.php
Normal file
23
Core/Driver/SQL/Expression/DateAdd.class.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
use Core\Driver\SQL\SQL;
|
||||
|
||||
class DateAdd extends Expression {
|
||||
|
||||
private Expression $lhs;
|
||||
private Expression $rhs;
|
||||
private string $unit;
|
||||
|
||||
public function __construct(Expression $lhs, Expression $rhs, string $unit) {
|
||||
$this->lhs = $lhs;
|
||||
$this->rhs = $rhs;
|
||||
$this->unit = $unit;
|
||||
}
|
||||
|
||||
public function getLHS(): Expression { return $this->lhs; }
|
||||
public function getRHS(): Expression { return $this->rhs; }
|
||||
public function getUnit(): string { return $this->unit; }
|
||||
|
||||
}
|
||||
23
Core/Driver/SQL/Expression/DateSub.class.php
Normal file
23
Core/Driver/SQL/Expression/DateSub.class.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
use Core\Driver\SQL\SQL;
|
||||
|
||||
class DateSub extends Expression {
|
||||
|
||||
private Expression $lhs;
|
||||
private Expression $rhs;
|
||||
private string $unit;
|
||||
|
||||
public function __construct(Expression $lhs, Expression $rhs, string $unit) {
|
||||
$this->lhs = $lhs;
|
||||
$this->rhs = $rhs;
|
||||
$this->unit = $unit;
|
||||
}
|
||||
|
||||
public function getLHS(): Expression { return $this->lhs; }
|
||||
public function getRHS(): Expression { return $this->rhs; }
|
||||
public function getUnit(): string { return $this->unit; }
|
||||
|
||||
}
|
||||
9
Core/Driver/SQL/Expression/Expression.class.php
Normal file
9
Core/Driver/SQL/Expression/Expression.class.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
use Core\Driver\SQL\SQL;
|
||||
|
||||
abstract class Expression {
|
||||
|
||||
}
|
||||
18
Core/Driver/SQL/Expression/JsonArrayAgg.class.php
Normal file
18
Core/Driver/SQL/Expression/JsonArrayAgg.class.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
class JsonArrayAgg extends Expression {
|
||||
|
||||
private $value;
|
||||
private string $alias;
|
||||
|
||||
public function __construct($value, string $alias) {
|
||||
$this->value = $value;
|
||||
$this->alias = $alias;
|
||||
}
|
||||
|
||||
public function getValue() { return $this->value; }
|
||||
public function getAlias(): string { return $this->alias; }
|
||||
|
||||
}
|
||||
18
Core/Driver/SQL/Expression/Sum.class.php
Normal file
18
Core/Driver/SQL/Expression/Sum.class.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Core\Driver\SQL\Expression;
|
||||
|
||||
class Sum extends Expression {
|
||||
|
||||
private $value;
|
||||
private string $alias;
|
||||
|
||||
public function __construct($value, string $alias) {
|
||||
$this->value = $value;
|
||||
$this->alias = $alias;
|
||||
}
|
||||
|
||||
public function getValue() { return $this->value; }
|
||||
public function getAlias(): string { return $this->alias; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user