1 | <?php |
||
17 | abstract class AbstractIteratorReader extends AbstractConfigurableStepElement implements ItemReaderInterface, |
||
|
|||
18 | StepExecutionAwareInterface |
||
19 | { |
||
20 | /** @var \Iterator */ |
||
21 | protected $iterator; |
||
22 | |||
23 | /** @var StepExecution */ |
||
24 | protected $stepExecution; |
||
25 | |||
26 | /** @var boolean */ |
||
27 | protected $batchMode; |
||
28 | |||
29 | /** |
||
30 | * @param boolean $batchMode |
||
31 | */ |
||
32 | public function __construct($batchMode = false) |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function setStepExecution(StepExecution $stepExecution) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function read() |
||
66 | |||
67 | /** |
||
68 | * Resets the state of the reader |
||
69 | */ |
||
70 | public function reset() |
||
74 | |||
75 | /** |
||
76 | * Rewinds the iterator if it has already been initialized. |
||
77 | * It allows to use the same service in two successive steps |
||
78 | * |
||
79 | * {@inheritdoc} |
||
80 | */ |
||
81 | public function initialize() |
||
85 | |||
86 | /** |
||
87 | * Converts an entity numerical identifier ('sku' for products, |
||
88 | * 'code' for other entities) into string to allow import. |
||
89 | * |
||
90 | * @param array $item |
||
91 | * |
||
92 | * @return array |
||
93 | */ |
||
94 | protected function convertNumericIdentifierToString(array $item) |
||
98 | |||
99 | /** |
||
100 | * Initializes the iterator |
||
101 | */ |
||
102 | protected function initializeIterator() |
||
110 | |||
111 | /** |
||
112 | * Creates the iterator |
||
113 | * |
||
114 | * @return \Iterator |
||
115 | */ |
||
116 | abstract protected function createIterator(); |
||
117 | } |
||
118 |