Documentation

Statement
in package

Criteria to filter a {@link TabularData} object.

Tags
phpstan-import-type

ConditionExtended from Query\PredicateCombinator

phpstan-import-type

OrderingExtended from Query\SortCombinator

Table of Contents

Constants

COLUMN_ALL  = 0
COLUMN_EXCLUDE  = 2
COLUMN_INCLUDE  = 1

Properties

$limit  : int
iterator maximum length.
$offset  : int
iterator Offset.
$order_by  : array<string|int, OrderingExtended>
$select  : array<string|int, string|int>
$select_mode  : self::COLUMN_*
$where  : array<string|int, ConditionExtended>

Methods

andWhere()  : self
andWhereColumn()  : self
andWhereOffset()  : self
create()  : self
DEPRECATION WARNING! This method will be removed in the next major point release.
limit()  : self
Sets LimitIterator Count.
offset()  : self
Sets LimitIterator Offset.
orderBy()  : self
Sets an Iterator sorting callable function.
orderByAsc()  : self
Ascending ordering of the tabular data according to a column value.
orderByDesc()  : self
Descending ordering of the tabular data according to a column value.
orWhere()  : self
orWhereColumn()  : self
orWhereOffset()  : self
process()  : TabularDataReader
Executes the prepared Statement on the {@link TabularData} object.
select()  : self
Select all the columns from the tabular data that MUST BE present in the ResultSet.
selectAllExcept()  : self
Select all the columns from the tabular data that MUST NOT BE present in the ResultSet.
when()  : self
Apply the callback if the given "condition" is (or resolves to) true.
where()  : self
Sets the Iterator filter method.
whereNot()  : self
whereNotColumn()  : self
whereNotOffset()  : self
xorWhere()  : self
xorWhereColumn()  : self
xorWhereOffset()  : self
appendWhere()  : self
applyFilter()  : Iterator
Filters elements of an Iterator using a callback function.
applySelect()  : TabularDataReader
DEPRECATION WARNING! This method will be removed in the next major point release.
buildOrderBy()  : Iterator
Sorts the Iterator.
filter()  : CallbackFilterIterator
Filters elements of an Iterator using a callback function.
wrapSingleArgumentCallable()  : ConditionExtended
Sanitize the number of required parameters for a predicate.

Constants

COLUMN_ALL

protected final mixed COLUMN_ALL = 0

COLUMN_EXCLUDE

protected final mixed COLUMN_EXCLUDE = 2

COLUMN_INCLUDE

protected final mixed COLUMN_INCLUDE = 1

Properties

$limit

iterator maximum length.

protected int $limit = -1

$offset

iterator Offset.

protected int $offset = 0

$order_by

protected array<string|int, OrderingExtended> $order_by = []

Callables to sort the iterator.

$select

protected array<string|int, string|int> $select = []

$select_mode

protected self::COLUMN_* $select_mode = self::COLUMN_ALL

$where

protected array<string|int, ConditionExtended> $where = []

Callables to filter the iterator.

Methods

andWhere()

public andWhere(string|int $column, Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$column : string|int
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

andWhereColumn()

public andWhereColumn(string|int $first, Comparison|callable|string $operator, array<string|int, mixed>|int|string $second) : self
Parameters
$first : string|int
$operator : Comparison|callable|string
$second : array<string|int, mixed>|int|string
Return values
self

andWhereOffset()

public andWhereOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

create()

DEPRECATION WARNING! This method will be removed in the next major point release.

public static create([ Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64 callable(array<string|int, mixed>, Array): bool|null $where = null ][, int $offset = 0 ][, int $limit = -1 ]) : self

Since version 9.22.0

use League\Csv\Statement::__construct() instead

Parameters
$where : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64 callable(array<string|int, mixed>, Array): bool|null = null

, Deprecated argument use Statement::where instead

$offset : int = 0

, Deprecated argument use Statement::offset instead

$limit : int = -1

, Deprecated argument use Statement::limit instead

Tags
throws
Exception
throws
InvalidArgument
throws
ReflectionException
see
Statement::__construct()
codeCoverageIgnore
Return values
self

limit()

Sets LimitIterator Count.

public limit(int $limit) : self
Parameters
$limit : int
Tags
throws
Exception

if the limit is less than -1

Return values
self

offset()

Sets LimitIterator Offset.

public offset(int $offset) : self
Parameters
$offset : int
Tags
throws
Exception

if the offset is less than 0

Return values
self

orderBy()

Sets an Iterator sorting callable function.

public orderBy(OrderingExtended $order_by) : self
Parameters
$order_by : OrderingExtended
Return values
self

orderByAsc()

Ascending ordering of the tabular data according to a column value.

public orderByAsc(string|int $column[, callable|Closure|null $callback = null ]) : self

The column value can be modified using the callback before ordering.

Parameters
$column : string|int
$callback : callable|Closure|null = null
Return values
self

orderByDesc()

Descending ordering of the tabular data according to a column value.

public orderByDesc(string|int $column[, callable|Closure|null $callback = null ]) : self

The column value can be modified using the callback before ordering.

Parameters
$column : string|int
$callback : callable|Closure|null = null
Return values
self

orWhere()

public orWhere(string|int $column, Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$column : string|int
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

orWhereColumn()

public orWhereColumn(string|int $first, Comparison|callable|string $operator, array<string|int, mixed>|int|string $second) : self
Parameters
$first : string|int
$operator : Comparison|callable|string
$second : array<string|int, mixed>|int|string
Return values
self

orWhereOffset()

public orWhereOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

select()

Select all the columns from the tabular data that MUST BE present in the ResultSet.

public select(string|int ...$columns) : self
Parameters
$columns : string|int
Return values
self

selectAllExcept()

Select all the columns from the tabular data that MUST NOT BE present in the ResultSet.

public selectAllExcept(string|int ...$columns) : self
Parameters
$columns : string|int
Return values
self

when()

Apply the callback if the given "condition" is (or resolves to) true.

public when(callable($this): bool|bool $condition, Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78 callable($this): Array $onSuccess[, Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78 callable($this): Array|null $onFail = null ]) : self
Parameters
$condition : callable($this): bool|bool
$onSuccess : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78 callable($this): Array
$onFail : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 78 callable($this): Array|null = null
Return values
self

where()

Sets the Iterator filter method.

public where( Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64 callable(array<string|int, mixed>, Array): bool $where) : self
Parameters
$where : Warning: Array to string conversion in C:\xampp\htdocs\vendor\phpdocumentor\phpdocumentor\src\phpDocumentor\Transformer\Writer\Twig\LinkRenderer\CallableAdapter.php on line 64 callable(array<string|int, mixed>, Array): bool
Tags
throws
ReflectionException
throws
InvalidArgument
Return values
self

whereNot()

public whereNot(string|int $column, Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$column : string|int
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

whereNotColumn()

public whereNotColumn(string|int $first, Comparison|callable|string $operator, array<string|int, mixed>|int|string $second) : self
Parameters
$first : string|int
$operator : Comparison|callable|string
$second : array<string|int, mixed>|int|string
Return values
self

whereNotOffset()

public whereNotOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

xorWhere()

public xorWhere(string|int $column, Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$column : string|int
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

xorWhereColumn()

public xorWhereColumn(string|int $first, Comparison|callable|string $operator, array<string|int, mixed>|int|string $second) : self
Parameters
$first : string|int
$operator : Comparison|callable|string
$second : array<string|int, mixed>|int|string
Return values
self

xorWhereOffset()

public xorWhereOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
$operator : Comparison|Closure|callable|string
$value : mixed = null
Return values
self

appendWhere()

protected final appendWhere("and"|"not"|"or"|"xor" $joiner, Predicate $predicate) : self
Parameters
$joiner : "and"|"not"|"or"|"xor"
$predicate : Predicate
Return values
self

applyFilter()

Filters elements of an Iterator using a callback function.

protected applyFilter(Iterator $iterator) : Iterator

Since version 9.16.0

this method no longer affects on the outcome of the class, use League\Csv\Statement::process() instead

DEPRECATION WARNING! This method will be removed in the next major point release.

Parameters
$iterator : Iterator
Tags
see
Statement::process()
codeCoverageIgnore
Return values
Iterator

applySelect()

DEPRECATION WARNING! This method will be removed in the next major point release.

protected applySelect(Iterator $records, array<string|int, mixed> $recordsHeader, array<string|int, mixed> $select) : TabularDataReader

Since version 9.16.0

this method no longer affects on the outcome of the class, use League\Csv\Statement::process() instead

Parameters
$records : Iterator
$recordsHeader : array<string|int, mixed>
$select : array<string|int, mixed>
Tags
throws
InvalidArgument
throws
SyntaxError
see
Statement::process()
Return values
TabularDataReader

buildOrderBy()

Sorts the Iterator.

protected buildOrderBy(Iterator $iterator) : Iterator

Since version 9.16.0

this method no longer affects on the outcome of the class, use League\Csv\Statement::process() instead

DEPRECATION WARNING! This method will be removed in the next major point release.

Parameters
$iterator : Iterator
Tags
see
Statement::process()
codeCoverageIgnore
Return values
Iterator

filter()

Filters elements of an Iterator using a callback function.

protected filter(Iterator $iterator, callable $callable) : CallbackFilterIterator

Since version 9.15.0

this method no longer affects on the outcome of the class, use League\Csv\Statement::applyFilter() instead

DEPRECATION WARNING! This method will be removed in the next major point release.

Parameters
$iterator : Iterator
$callable : callable
Tags
see
Statement::applyFilter()
codeCoverageIgnore
Return values
CallbackFilterIterator

wrapSingleArgumentCallable()

Sanitize the number of required parameters for a predicate.

protected final static wrapSingleArgumentCallable(callable $where) : ConditionExtended

To avoid BC break in 9.16+ version the predicate should have at least 1 required argument.

Parameters
$where : callable
Tags
throws
InvalidArgument
throws
ReflectionException
Return values
ConditionExtended

        
On this page

Search results