| Methods |
public
|
__construct(
array<int, AbstractScope|Expressionable|array{(string|Expressionable), 1?: mixed, 2?: mixed}> $conditions = [],
string $junction = self::AND,
)
Create a Scope from array of condition objects or condition arrays.
Create a Scope from array of condition objects or condition arrays.
Overriden by
|
#
|
public
|
__clone()
|
#
|
public
|
addCondition(
AbstractScope|array<int, AbstractScope|Expressionable|array{(string|Expressionable), 1?: mixed, 2?: mixed}>|string|Expressionable $field,
($field is string|Expressionable ? ($value is null ? mixed : string) : never) $operator = null,
($operator is string ? mixed : never) $value = null,
): $this
|
#
|
public
|
getNestedConditions(): array<AbstractScope>
Return array of nested conditions.
Return array of nested conditions.
|
#
|
protected
|
onChangeModel(): void
|
#
|
public
|
isEmpty(): bool
Return if scope has any conditions.
Return if scope has any conditions.
Implements
|
#
|
public
|
isCompound(): bool
Returns if scope contains several conditions.
Returns if scope contains several conditions.
Overrides
|
#
|
public
|
getJunction(): self::AND|self::OR
|
#
|
public
|
isOr(): bool
Checks if junction is OR.
Checks if junction is OR.
|
#
|
public
|
isAnd(): bool
Checks if junction is AND.
Checks if junction is AND.
|
#
|
public
|
clear(): self
Empty the scope object.
|
#
|
public
|
simplify(): AbstractScope
Simplifies by peeling off nested group conditions with single contained component.
Useful for converting (((field =…
Simplifies by peeling off nested group conditions with single contained component.
Useful for converting (((field = value))) to field = value.
Overrides
|
#
|
public
|
negate(): self
Use De Morgan's laws to negate.
Use De Morgan's laws to negate.
Overriden by
Implements
|
#
|
public
|
toWords(Model $model = null): string
Convert the scope to human readable words when applied on $model.
Convert the scope to human readable words when applied on $model.
Implements
|
#
|
public
static
|
createAnd(AbstractScope|Expressionable|array{(string|Expressionable), 1?: mixed, 2?: mixed} ...$conditions): static
|
#
|
public
static
|
createOr(AbstractScope|Expressionable|array{(string|Expressionable), 1?: mixed, 2?: mixed} ...$conditions): static
|
#
|