QueryFilter
A Trait to Query rows against a SplFileObject
Tags
Table of Contents
- $iterator_filters : array<string|int, callable>
- Callables to filter the iterator
- $iterator_limit : int
- iterator maximum length
- $iterator_offset : int
- iterator Offset
- $iterator_sort_by : array<string|int, callable>
- Callables to sort the iterator
- $strip_bom : bool
- Stripping BOM status
- addFilter() : $this
- Set the Iterator filter method
- addSortBy() : $this
- Set an Iterator sorting callable function
- getEnclosure() : mixed
- getInputBOM() : mixed
- getIterator() : mixed
- setLimit() : $this
- Set LimitIterator Count
- setOffset() : $this
- Set LimitIterator Offset
- stripBom() : $this
- Stripping BOM setter
- applyBomStripping() : Iterator
- Remove the BOM sequence from the CSV
- applyIteratorFilter() : Iterator
- Filter the Iterator
- applyIteratorInterval() : Iterator
- Sort the Iterator
- applyIteratorSortBy() : Iterator
- Sort the Iterator
- getQueryIterator() : Iterator
- Returns the CSV Iterator
- getStripBomIterator() : Iterator
- Return the Iterator without the BOM sequence
- isBomStrippable() : bool
- Tell whether we can strip or not the leading BOM sequence
- validateInteger() : mixed
Properties
$iterator_filters
Callables to filter the iterator
protected
array<string|int, callable>
$iterator_filters
= []
$iterator_limit
iterator maximum length
protected
int
$iterator_limit
= -1
$iterator_offset
iterator Offset
protected
int
$iterator_offset
= 0
$iterator_sort_by
Callables to sort the iterator
protected
array<string|int, callable>
$iterator_sort_by
= []
$strip_bom
Stripping BOM status
protected
bool
$strip_bom
= false
Methods
addFilter()
Set the Iterator filter method
public
addFilter(callable $callable) : $this
Parameters
- $callable : callable
Return values
$this —addSortBy()
Set an Iterator sorting callable function
public
addSortBy(callable $callable) : $this
Parameters
- $callable : callable
Return values
$this —getEnclosure()
public
abstract getEnclosure() : mixed
Tags
Return values
mixed —getInputBOM()
public
abstract getInputBOM() : mixed
Tags
Return values
mixed —getIterator()
public
abstract getIterator() : mixed
Tags
Return values
mixed —setLimit()
Set LimitIterator Count
public
setLimit([int $limit = -1 ]) : $this
Parameters
- $limit : int = -1
Return values
$this —setOffset()
Set LimitIterator Offset
public
setOffset( $offset) : $this
Parameters
Return values
$this —stripBom()
Stripping BOM setter
public
stripBom(bool $status) : $this
Parameters
- $status : bool
Return values
$this —applyBomStripping()
Remove the BOM sequence from the CSV
protected
applyBomStripping(Iterator $iterator) : Iterator
Parameters
- $iterator : Iterator
Return values
Iterator —applyIteratorFilter()
Filter the Iterator
protected
applyIteratorFilter(Iterator $iterator) : Iterator
Parameters
- $iterator : Iterator
Return values
Iterator —applyIteratorInterval()
Sort the Iterator
protected
applyIteratorInterval(Iterator $iterator) : Iterator
Parameters
- $iterator : Iterator
Return values
Iterator —applyIteratorSortBy()
Sort the Iterator
protected
applyIteratorSortBy(Iterator $iterator) : Iterator
Parameters
- $iterator : Iterator
Return values
Iterator —getQueryIterator()
Returns the CSV Iterator
protected
getQueryIterator() : Iterator
Return values
Iterator —getStripBomIterator()
Return the Iterator without the BOM sequence
protected
getStripBomIterator(Iterator $iterator) : Iterator
Parameters
- $iterator : Iterator
Return values
Iterator —isBomStrippable()
Tell whether we can strip or not the leading BOM sequence
protected
isBomStrippable() : bool
Return values
bool —validateInteger()
protected
abstract validateInteger(mixed $int, mixed $minValue, mixed $errorMessage) : mixed
Parameters
- $int : mixed
- $minValue : mixed
- $errorMessage : mixed