Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,34 @@ | ||
Loaders | ||
======= | ||
The loaders are responsible to save or output your transformed data. | ||
The loaders are responsible to save or output your transformed data. Here are some built-in loaders, feel free to implement your own ones. | ||
|
||
Feel free to implement your own ones. | ||
|
||
ArrayLoader | ||
----------- | ||
This loader stores your data into an array. | ||
|
||
DebugLoader | ||
----------- | ||
At the end of the process, this loader `var_dump` your data. You can use another debug function in the constructor if needed. | ||
|
||
FileLoader | ||
---------- | ||
This loader saves your data in a file. Make sure your transformer adds a `PHP_EOL` if you want a line for each load (you can also hook on the `ETLEvents::AFTER_TRANSFORM` event) | ||
|
||
CsvFileLoader | ||
------------- | ||
This loader will take your `SplFileObject` and call `fputcsv` on each load. | ||
|
||
JsonFileLoader | ||
-------------- | ||
This loader will store your data as a Json file. | ||
|
||
|
||
Loaders and FlushableLoaders | ||
============================ | ||
By default, each loader will store your data when invoked. | ||
|
||
You can create your own loader by implementing `BenTools\ETL\Loader\FlushableLoaderInterface`, which will cause the loader to buffer elements and store them only when the `flush()` method is called (cf. `BenTools\ETL\Loader\DoctrineORMLoader`). | ||
|
||
|
||
Next: [Events](Events.md) |