Core Update 1.4.0
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
namespace Driver\SQL;
|
||||
|
||||
use Driver\SQL\Column\Column;
|
||||
use Driver\SQL\Condition\Compare;
|
||||
|
||||
class Join {
|
||||
|
||||
private string $type;
|
||||
@@ -9,13 +12,16 @@ class Join {
|
||||
private string $columnA;
|
||||
private string $columnB;
|
||||
private ?string $tableAlias;
|
||||
private array $conditions;
|
||||
|
||||
public function __construct(string $type, string $table, string $columnA, string $columnB, ?string $tableAlias = null) {
|
||||
public function __construct(string $type, string $table, string $columnA, string $columnB, ?string $tableAlias = null, array $conditions = []) {
|
||||
$this->type = $type;
|
||||
$this->table = $table;
|
||||
$this->columnA = $columnA;
|
||||
$this->columnB = $columnB;
|
||||
$this->tableAlias = $tableAlias;
|
||||
$this->conditions = $conditions;
|
||||
array_unshift($this->conditions , new Compare($columnA, new Column($columnB), "="));
|
||||
}
|
||||
|
||||
public function getType(): string { return $this->type; }
|
||||
@@ -23,5 +29,6 @@ class Join {
|
||||
public function getColumnA(): string { return $this->columnA; }
|
||||
public function getColumnB(): string { return $this->columnB; }
|
||||
public function getTableAlias(): ?string { return $this->tableAlias; }
|
||||
public function getConditions(): array { return $this->conditions; }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user