ZipStream
This commit is contained in:
16
core/Driver/SQL/Condition/CondNull.class.php
Normal file
16
core/Driver/SQL/Condition/CondNull.class.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Driver\Sql\Condition;
|
||||
|
||||
|
||||
class CondNull extends Condition {
|
||||
|
||||
private string $column;
|
||||
|
||||
public function __construct(string $col) {
|
||||
$this->column = $col;
|
||||
}
|
||||
|
||||
public function getColumn() { return $this->column; }
|
||||
}
|
||||
@@ -9,6 +9,7 @@ use Driver\SQL\Condition\CondIn;
|
||||
use Driver\SQL\Condition\Condition;
|
||||
use Driver\SQL\Condition\CondKeyword;
|
||||
use Driver\SQL\Condition\CondNot;
|
||||
use Driver\Sql\Condition\CondNull;
|
||||
use Driver\SQL\Condition\CondOr;
|
||||
use Driver\SQL\Constraint\Constraint;
|
||||
use \Driver\SQL\Constraint\Unique;
|
||||
@@ -398,6 +399,8 @@ abstract class SQL {
|
||||
}
|
||||
|
||||
return "NOT $expression";
|
||||
} else if($condition instanceof CondNull) {
|
||||
return $this->columnName($condition->getColumn()) . " IS NULL";
|
||||
} else {
|
||||
$this->lastError = "Unsupported condition type: " . get_class($condition);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user