0 follower

Interface Yiisoft\Data\Reader\FilterableDataInterface

ExtendsYiisoft\Data\Reader\ReadableDataInterface
Implemented byYiisoft\Data\Reader\DataReaderInterface

Data that could be filtered.

Filtering is done in two steps:

  • Criteria of reading data is modified according to {@see \Yiisoft\Data\Reader\FilterInterface}
  • Resulting items are iterated over and filter handler matching {@see \Yiisoft\Data\Reader\FilterInterface::getOperator()} is applied

For performance reasons, prefer filtering as many items as possible in the first step.

Public Methods

Hide inherited methods

Method Description Defined By
getFilter() Get current data reading criteria. Yiisoft\Data\Reader\FilterableDataInterface
read() Get iterable for the data set. Yiisoft\Data\Reader\ReadableDataInterface
readOne() Get one item from the data set. Which item is returned is up to implementation. Yiisoft\Data\Reader\ReadableDataInterface
withFilter() Returns new instance with data reading criteria set. Yiisoft\Data\Reader\FilterableDataInterface

Method Details

Hide inherited methods

getFilter() public abstract method

Get current data reading criteria.

public abstract Yiisoft\Data\Reader\FilterInterface getFilter ( )
return Yiisoft\Data\Reader\FilterInterface

Data reading criteria.

                public function getFilter(): FilterInterface;

            
read() public abstract method

Defined in: Yiisoft\Data\Reader\ReadableDataInterface::read()

Get iterable for the data set.

public abstract iterable read ( )
return iterable

Iterable for the data. Note that keys could be anything so you shouldn't rely on these.

                public function read(): iterable;

            
readOne() public abstract method

Defined in: Yiisoft\Data\Reader\ReadableDataInterface::readOne()

Get one item from the data set. Which item is returned is up to implementation.

Note that invoking this method doesn't impact the data set or its pointer.

public abstract array|object|null readOne ( )
return array|object|null

An item or null if there is none.

                public function readOne(): array|object|null;

            
withFilter() public abstract method

Returns new instance with data reading criteria set.

public abstract Yiisoft\Data\Reader\FilterableDataInterface withFilter ( Yiisoft\Data\Reader\FilterInterface $filter )
$filter Yiisoft\Data\Reader\FilterInterface

Data reading criteria.

return Yiisoft\Data\Reader\FilterableDataInterface

New instance.

                public function withFilter(FilterInterface $filter): static;