Statement
in package
Criteria to filter a {@link TabularData} object.
Tags
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
selfandWhereColumn()
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
selfandWhereOffset()
public
andWhereOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
- $operator : Comparison|Closure|callable|string
- $value : mixed = null
Return values
selfcreate()
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
Return values
selflimit()
Sets LimitIterator Count.
public
limit(int $limit) : self
Parameters
- $limit : int
Tags
Return values
selfoffset()
Sets LimitIterator Offset.
public
offset(int $offset) : self
Parameters
- $offset : int
Tags
Return values
selforderBy()
Sets an Iterator sorting callable function.
public
orderBy(OrderingExtended $order_by) : self
Parameters
- $order_by : OrderingExtended
Return values
selforderByAsc()
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
selforderByDesc()
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
selforWhere()
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
selforWhereColumn()
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
selforWhereOffset()
public
orWhereOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
- $operator : Comparison|Closure|callable|string
- $value : mixed = null
Return values
selfprocess()
Executes the prepared Statement on the {@link TabularData} object.
public
process(TabularData|TabularDataProvider $tabular_data[, array<string|int, string> $header = [] ]) : TabularDataReader
Parameters
- $tabular_data : TabularData|TabularDataProvider
- $header : array<string|int, string> = []
-
an optional header to use instead of the tabular data header
Tags
Return values
TabularDataReaderselect()
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
selfselectAllExcept()
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
selfwhen()
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
selfwhere()
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
Return values
selfwhereNot()
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
selfwhereNotColumn()
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
selfwhereNotOffset()
public
whereNotOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
- $operator : Comparison|Closure|callable|string
- $value : mixed = null
Return values
selfxorWhere()
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
selfxorWhereColumn()
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
selfxorWhereOffset()
public
xorWhereOffset(Comparison|Closure|callable|string $operator[, mixed $value = null ]) : self
Parameters
- $operator : Comparison|Closure|callable|string
- $value : mixed = null
Return values
selfappendWhere()
protected
final appendWhere("and"|"not"|"or"|"xor" $joiner, Predicate $predicate) : self
Parameters
- $joiner : "and"|"not"|"or"|"xor"
- $predicate : Predicate
Return values
selfapplyFilter()
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
Return values
IteratorapplySelect()
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
Return values
TabularDataReaderbuildOrderBy()
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
Return values
Iteratorfilter()
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
Return values
CallbackFilterIteratorwrapSingleArgumentCallable()
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