Merge branch 'master' of https://git.mcnd.ca/mcndave/ulmus
This commit is contained in:
commit
eb6434bb72
6 files changed
+44
-35
No files matched your search
+9
-4
@@ -76,7 +76,7 @@ class Where extends Fragment {
|
||||
protected function whereCondition($field, $value, string $operator = self::OPERATOR_EQUAL, string $condition = self::CONDITION_AND, bool $not = false) {
|
||||
return new class($this->queryBuilder, $field, $value, $operator, $condition, $not) {
|
||||
|
||||
public $value;
|
||||
public mixed $value;
|
||||
public bool $not = false;
|
||||
public string $field;
|
||||
public string $operator;
|
||||
@@ -85,7 +85,7 @@ class Where extends Fragment {
|
||||
|
||||
protected string $content = "";
|
||||
|
||||
public function __construct(QueryBuilderInterface $queryBuilder, string $field, $value, string $operator, string $condition, bool $not) {
|
||||
public function __construct(QueryBuilderInterface $queryBuilder, string $field, mixed $value, string $operator, string $condition, bool $not) {
|
||||
$this->queryBuilder = $queryBuilder;
|
||||
$this->field = $field;
|
||||
$this->value = $value;
|
||||
@@ -122,8 +122,13 @@ class Where extends Fragment {
|
||||
if ( is_array($this->value) ) {
|
||||
$stack = [];
|
||||
|
||||
foreach($this->value as $item) {
|
||||
$stack[] = $this->filterValue($item);
|
||||
if ($this->value) {
|
||||
foreach ($this->value as $item) {
|
||||
$stack[] = $this->filterValue($item);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$stack[] = $this->filterValue(false);
|
||||
}
|
||||
|
||||
return "(" . implode(", ", $stack) . ")";
|
||||
|
||||
@@ -4,4 +4,4 @@
|
||||
namespace Ulmus\Query;
|
||||
|
||||
|
||||
interface WhereRawParameter {}
|
||||
interface WhereRawParameter extends \Stringable {}
|
||||
Reference in new issue
Block a user