Documentation

TwoColumns
in package
implements Predicate

FinalYes

Enable filtering a record by comparing the values of two of its column.

When used with PHP's array_filter with the ARRAY_FILTER_USE_BOTH flag the record offset WILL NOT BE taken into account

Table of Contents

Interfaces

Predicate
Enable filtering a record based on its value and/or its offset.

Properties

$first  : string|int
$operator  : Comparison|Closure
$second  : array<string|int, mixed>|string|int

Methods

__invoke()  : bool
The class predicate method.
filter()  : Iterator
Filters elements of an iterable structure using the class predicate method.
filterOn()  : self
__construct()  : mixed

Properties

$second read-only

public array<string|int, mixed>|string|int $second

Methods

__invoke()

The class predicate method.

public __invoke(mixed $value, int|string $key) : bool
Parameters
$value : mixed
$key : int|string
Tags
throws
QueryException
throws
ReflectionException
Return values
bool

filter()

Filters elements of an iterable structure using the class predicate method.

public filter(iterable<string|int, mixed> $value) : Iterator
Parameters
$value : iterable<string|int, mixed>
Return values
Iterator

filterOn()

public static filterOn(string|int $firstColumn, Comparison|Closure|callable|string $operator, array<string|int, mixed>|string|int $secondColumn) : self
Parameters
$firstColumn : string|int
$operator : Comparison|Closure|callable|string
$secondColumn : array<string|int, mixed>|string|int
Tags
throws
QueryException
Return values
self

__construct()

private __construct(string|int $first, Comparison|Closure $operator, array<string|int, mixed>|string|int $second) : mixed
Parameters
$first : string|int
$operator : Comparison|Closure
$second : array<string|int, mixed>|string|int
Tags
throws
QueryException

        
On this page

Search results