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
@@ -195,12 +195,12 @@ class QueryBuilder implements Query\QueryBuilderInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function where(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL, string $condition = Query\Where::CONDITION_AND, bool $not = false) : self
|
||||
public function where(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL, string $condition = Query\Where::CONDITION_AND, bool $not = false) : self
|
||||
{
|
||||
# Empty IN case
|
||||
if ( [] === $value ) {
|
||||
return $this;
|
||||
}
|
||||
#if ( [] === $value ) {
|
||||
# return $this;
|
||||
#}
|
||||
|
||||
if ( $this->where ?? false ) {
|
||||
$where = $this->where;
|
||||
@@ -217,12 +217,12 @@ class QueryBuilder implements Query\QueryBuilderInterface
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notWhere(string|\Stringable $field, $value, string $operator = Query\Where::CONDITION_AND) : self
|
||||
public function notWhere(string|\Stringable $field, mixed $value, string $operator = Query\Where::CONDITION_AND) : self
|
||||
{
|
||||
return $this->where($field, $value, $operator, true);
|
||||
}
|
||||
|
||||
public function having(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL, string $condition = Query\Where::CONDITION_AND, bool $not = false) : self
|
||||
public function having(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL, string $condition = Query\Where::CONDITION_AND, bool $not = false) : self
|
||||
{
|
||||
if ( $this->having ?? false ) {
|
||||
$having = $this->having;
|
||||
@@ -476,7 +476,7 @@ class QueryBuilder implements Query\QueryBuilderInterface
|
||||
return null;
|
||||
}
|
||||
|
||||
public function removeFragment(/*Query\Fragment|array*/ $fragment) : void
|
||||
public function removeFragment(Query\Fragment|array|\Stringable|string $fragment) : void
|
||||
{
|
||||
is_object($fragment) && $fragment = get_class($fragment);
|
||||
|
||||
@@ -494,7 +494,7 @@ class QueryBuilder implements Query\QueryBuilderInterface
|
||||
}
|
||||
}
|
||||
|
||||
public function getFragments(/*? Query\Fragment|array*/ $fragment = null) : array
|
||||
public function getFragments(Query\Fragment|array|\Stringable|string $fragment = null) : array
|
||||
{
|
||||
return $fragment !== null ? array_filter($this->queryStack, fn($e) => is_a($e, $fragment, true) ) : $this->queryStack;
|
||||
}
|
||||
@@ -504,7 +504,7 @@ class QueryBuilder implements Query\QueryBuilderInterface
|
||||
return $this->render();
|
||||
}
|
||||
|
||||
public function addParameter($value, string $key = null) : string
|
||||
public function addParameter(mixed $value, string $key = null) : string
|
||||
{
|
||||
if ( $this->parent ?? false ) {
|
||||
return $this->parent->addParameter($value, $key);
|
||||
|
||||
Reference in new issue
Block a user