ajout méthodes random,index dans la collection, ajout clause distinct, whereNull , whereNotNull dans le querybuilder

This commit is contained in:
Gregory Letellier
2023-11-02 10:27:06 +01:00
parent fe6d2f27b8
commit 84bf765b84
5 changed files with 79 additions and 3 deletions

View File

@@ -25,9 +25,21 @@ class Expression
if ($operator == "between" && count($this->value) == 2) {
return "(" . $this->condition . " " . $this->operator . " ? AND ? )";
}
if ($operator == "notnull") {
return "(" . $this->condition . " IS NOT NULL )";
}
if ($operator == "isnull") {
return "(" . $this->condition . " IS NULL )";
}
return "(" . $this->condition . " " . $this->operator . " ? )";
}
public function hasData()
{
$operator = trim(strtolower($this->operator));
return (in_array($operator, ["isnull","notnull"])) ? false : true;
}
public function getCondition()
{
return $this->condition;