This commit is contained in:
mcndave committed 2023-03-30 15:24:58 +00:00
commit eb6434bb72
6 files changed
+44 -35

No files matched your search

+17 -17
View File
@@ -25,7 +25,7 @@ trait ConditionTrait
return $this;
}
public function where(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
public function where(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
{
$this->queryBuilder->where($field, $value, $operator, $condition);
@@ -41,101 +41,101 @@ trait ConditionTrait
return $this;
}
public function and(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
public function and(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
{
return $this->where($field, $value, $operator);
}
public function or(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
public function or(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
{
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_OR);
return $this;
}
public function notWhere(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
public function notWhere(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
{
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_AND, true);
return $this;
}
public function orNot(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
public function orNot(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
{
$this->queryBuilder->notWhere($field, $value, $operator, Query\Where::CONDITION_OR, true);
return $this;
}
public function having(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
public function having(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
{
$this->queryBuilder->having($field, $value, $operator, $condition);
return $this;
}
public function orHaving(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
public function orHaving(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
{
$this->queryBuilder->having($field, $value, $operator, Query\Where::CONDITION_OR);
return $this;
}
public function notHaving(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
public function notHaving(string|\Stringable $field, mixed $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
{
$this->queryBuilder->having($field, $value, $operator, Query\Where::CONDITION_AND, true);
return $this;
}
public function orNotHaving(string|\Stringable $field, $value) : self
public function orNotHaving(string|\Stringable $field, mixed $value) : self
{
$this->queryBuilder->having($field, $value, Query\Where::OPERATOR_NOT_EQUAL, Query\Where::CONDITION_OR, true);
return $this;
}
public function in(string|\Stringable $field, $value, string $operator = Query\Where::COMPARISON_IN) : self
public function in(string|\Stringable $field, mixed $value, string $operator = Query\Where::COMPARISON_IN) : self
{
$this->queryBuilder->where($field, $value, $operator);
return $this;
}
public function orIn(string|\Stringable $field, $value, string $operator = Query\Where::COMPARISON_IN) : self
public function orIn(string|\Stringable $field, mixed $value, string $operator = Query\Where::COMPARISON_IN) : self
{
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_OR);
return $this;
}
public function notIn(string|\Stringable $field, $value) : self
public function notIn(string|\Stringable $field, mixed $value) : self
{
$this->queryBuilder->where($field, $value, Query\Where::COMPARISON_IN, Query\Where::CONDITION_AND, true);
return $this;
}
public function orNotIn(string|\Stringable $field, $value) : self
public function orNotIn(string|\Stringable $field, mixed $value) : self
{
return $this->orNot($field, $value, Query\Where::COMPARISON_IN, Query\Where::CONDITION_OR, true);
}
public function like(string|\Stringable $field, $value) : self
public function like(string|\Stringable $field, mixed $value) : self
{
$this->where($field, $value, Query\Where::OPERATOR_LIKE);
return $this;
}
public function orLike(string|\Stringable $field, $value) : self
public function orLike(string|\Stringable $field, mixed $value) : self
{
$this->or($field, $value, Query\Where::OPERATOR_LIKE);
return $this;
}
public function notLike(string|\Stringable $field, $value) : self
public function notLike(string|\Stringable $field, mixed $value) : self
{
$this->notWhere($field, $value, Query\Where::OPERATOR_LIKE);
@@ -151,7 +151,7 @@ trait ConditionTrait
return $this;
}
public function removeQueryFragment(/* Query\Fragment | stringable | array */ $fragment) : self
public function removeQueryFragment(Query\Fragment|\Stringable|string|array $fragment) : self
{
foreach((array) $fragment as $item) {
$this->queryBuilder->removeFragment($item);