What is an item writer? ============================================================ The item writer is used by the item job to load every processed item. It can be any class implementing `ItemWriterInterface `__. What types of item writers exists? ------------------------------------------------------------ **Built-in item writers:** * `JsonLinesWriter `__: write items as a json string each on a line of a file. * `ChainWriter `__: write items on multiple item writers. * `ConditionalWriter `__: will only write items that are matching your conditions. * `DispatchEventsWriter `__: will dispatch events before and after writing. * `LaunchJobForEachItemWriter `__: launch another job for each items. * `LaunchJobForItemsBatchWriter `__: launch another job for each item batches. * `NullWriter `__: do not write items. * `RoutingWriter `__: route writing to different writer based on your logic. * `SummaryWriter `__: write items to a job summary value. * `TransformingWriter `__: perform items transformation before delegating to another writer. * `CallbackWriter `__: delegate items write operations to a closure passed at construction. **Item writers from bridges:** * From ``symfony/messenger`` bridge: * `DispatchEachItemAsMessageWriter `__: dispatch each item as a message in a bus. * From ``doctrine/dbal`` bridge: * `DoctrineDBALInsertWriter `__: write items by inserting in a table via a Doctrine ``Connection``. * `DoctrineDBALUpsertWriter `__: write items by inserting/updating in a table via a Doctrine ``Connection``. * From ``doctrine/persistence`` bridge: * `ObjectWriter `__: write items to any Doctrine ``ObjectManager``. * From ``openspout/openspout`` bridge: * `FlatFileWriter `__: write items to any CSV/ODS/XLSX file. **Item writers for testing purpose:** * `InMemoryWriter `__: write in a private var which can be accessed afterward in your tests. * `TestDebugWriter `__: dummy item writer that you can use in your unit tests. .. seealso:: | :doc:`What is an item job? `