What is an item reader?
The item reader is used by the item job to extract item from a source.
It can be any class implementing ItemReaderInterface.
What types of item readers exists?
Built-in item readers:
FixedColumnSizeFileReader: read a file line by line, and decode each line with fixed columns size to an array.
JsonLinesReader: read a file line by line, and decode each line as JSON.
AddMetadataReader: decorates another reader by adding static information to each read item.
IndexWithReader: decorates another reader by changing index of each item.
ParameterAccessorReader: read from an inmemory value located at some configurable place.
SequenceReader: read from multiple item reader, one after the other.
StaticIterableReader: read from an iterable you provide during construction.
CallbackReader: read from a
Closureyou provide during construction.
Item readers from bridges:
From
openspout/openspoutbridge:FlatFileReader: read from any CSV/ODS/XLSX file.
From
doctrine/dbalbridge:DoctrineDBALQueryOffsetReader: execute an SQL query and iterate over results, using a limit + offset pagination strategy.
DoctrineDBALQueryCursorReader: execute an SQL query and iterate over results, using a column based cursor strategy.
From
doctrine/ormbridge:EntityReader: read from any Doctrine ORM entity.
Item readers for testing purpose:
TestDebugReader: dummy item reader that you can use in your unit tests.
See also