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 | * @deprecated will be remove in 1.7. Use initialize method instead. |
||
71 | */ |
||
72 | public function reset() |
||
76 | |||
77 | /** |
||
78 | * Initializes the iterator allowing to use the same service in two successive steps |
||
79 | * |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function initialize() |
||
86 | |||
87 | /** |
||
88 | * Converts an entity numerical identifier ('sku' for products, |
||
89 | * 'code' for other entities) into string to allow import. |
||
90 | * |
||
91 | * @param array $item |
||
92 | * |
||
93 | * @return array |
||
94 | */ |
||
95 | protected function convertNumericIdentifierToString(array $item) |
||
99 | |||
100 | /** |
||
101 | * Initializes the iterator |
||
102 | */ |
||
103 | protected function initializeIterator() |
||
111 | |||
112 | /** |
||
113 | * Creates the iterator |
||
114 | * |
||
115 | * @return \Iterator |
||
116 | */ |
||
117 | abstract protected function createIterator(); |
||
118 | } |
||
119 |