- WIP on attributes
This commit is contained in:
1 parent
e6d0279c1a
commit
70021d829d
13 files changed
+174
-36
No files matched your search
@@ -25,7 +25,7 @@ trait ConditionTrait
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function where($field, $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
|
||||
public function where(string|\Stringable $field, $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($field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
public function and(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
{
|
||||
return $this->where($field, $value, $operator);
|
||||
}
|
||||
|
||||
public function or($field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
public function or(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
{
|
||||
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_OR);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notWhere($field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
public function notWhere(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
{
|
||||
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_AND, true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orNot($field, $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
|
||||
public function orNot(string|\Stringable $field, $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($field, $value, string $operator = Query\Where::OPERATOR_EQUAL, $condition = Query\Where::CONDITION_AND) : self
|
||||
public function having(string|\Stringable $field, $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($field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
public function orHaving(string|\Stringable $field, $value, string $operator = Query\Where::OPERATOR_EQUAL) : self
|
||||
{
|
||||
$this->queryBuilder->having($field, $value, $operator, Query\Where::CONDITION_OR);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notHaving($field, $value, string $operator = Query\Where::OPERATOR_NOT_EQUAL) : self
|
||||
public function notHaving(string|\Stringable $field, $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($field, $value) : self
|
||||
public function orNotHaving(string|\Stringable $field, $value) : self
|
||||
{
|
||||
$this->queryBuilder->having($field, $value, Query\Where::OPERATOR_NOT_EQUAL, Query\Where::CONDITION_OR, true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function in($field, $value, string $operator = Query\Where::COMPARISON_IN) : self
|
||||
public function in(string|\Stringable $field, $value, string $operator = Query\Where::COMPARISON_IN) : self
|
||||
{
|
||||
$this->queryBuilder->where($field, $value, $operator);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orIn($field, $value, string $operator = Query\Where::COMPARISON_IN) : self
|
||||
public function orIn(string|\Stringable $field, $value, string $operator = Query\Where::COMPARISON_IN) : self
|
||||
{
|
||||
$this->queryBuilder->where($field, $value, $operator, Query\Where::CONDITION_OR);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notIn($field, $value) : self
|
||||
public function notIn(string|\Stringable $field, $value) : self
|
||||
{
|
||||
$this->queryBuilder->where($field, $value, Query\Where::COMPARISON_IN, true);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orNotIn($field, $value) : self
|
||||
public function orNotIn(string|\Stringable $field, $value) : self
|
||||
{
|
||||
return $this->orNot($field, $value, Query\Where::COMPARISON_IN, Query\Where::CONDITION_OR, true);
|
||||
}
|
||||
|
||||
public function like($field, $value) : self
|
||||
public function like(string|\Stringable $field, $value) : self
|
||||
{
|
||||
$this->where($field, $value, Query\Where::OPERATOR_LIKE);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function orLike($field, $value) : self
|
||||
public function orLike(string|\Stringable $field, $value) : self
|
||||
{
|
||||
$this->or($field, $value, Query\Where::OPERATOR_LIKE);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function notLike($field, $value) : self
|
||||
public function notLike(string|\Stringable $field, $value) : self
|
||||
{
|
||||
$this->notWhere($field, $value, Query\Where::OPERATOR_LIKE);
|
||||
|
||||
|
||||
Reference in new issue
Block a user