ajout des conditions where in et where between

This commit is contained in:
2023-10-29 18:37:35 +01:00
parent dad85948e5
commit 68de5a7d96
4 changed files with 52 additions and 2 deletions

View File

@@ -17,6 +17,14 @@ class Expression
public function raw(): string
{
$operator = trim(strtolower($this->operator));
if ($operator == "in") {
$values = implode(",", str_split(str_repeat("?", count($this->value))));
return "(" . $this->condition . " " . $this->operator . " (" . $values . ") )";
}
if ($operator == "between" && count($this->value) == 2) {
return "(" . $this->condition . " " . $this->operator . " ? AND ? )";
}
return "(" . $this->condition . " " . $this->operator . " ? )";
}