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 | * Initializes the iterator allowing to use the same service in two successive steps |
||
77 | * |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function initialize() |
||
84 | |||
85 | /** |
||
86 | * Converts an entity numerical identifier ('sku' for products, |
||
87 | * 'code' for other entities) into string to allow import. |
||
88 | * |
||
89 | * @param array $item |
||
90 | * |
||
91 | * @return array |
||
92 | */ |
||
93 | protected function convertNumericIdentifierToString(array $item) |
||
97 | |||
98 | /** |
||
99 | * Initializes the iterator |
||
100 | */ |
||
101 | protected function initializeIterator() |
||
109 | |||
110 | /** |
||
111 | * Creates the iterator |
||
112 | * |
||
113 | * @return \Iterator |
||
114 | */ |
||
115 | abstract protected function createIterator(); |
||
116 | } |
||
117 |