1 | <?php |
||
10 | class Importer |
||
11 | { |
||
12 | /** |
||
13 | * @var ReaderInterface |
||
14 | */ |
||
15 | protected $reader; |
||
16 | |||
17 | /** |
||
18 | * @var WriterInterface |
||
19 | */ |
||
20 | protected $writer; |
||
21 | |||
22 | /** |
||
23 | * @var LoggerInterface |
||
24 | */ |
||
25 | protected $logger; |
||
26 | |||
27 | /** |
||
28 | * @param ReaderInterface $reader |
||
29 | * @param WriterInterface $writer |
||
30 | * @param LoggerInterface $logger |
||
31 | */ |
||
32 | public function __construct(ReaderInterface $reader, WriterInterface $writer, LoggerInterface $logger = null) |
||
38 | |||
39 | /** |
||
40 | * @param int $limit |
||
41 | * @param ProgressInterface|null $progress |
||
42 | * |
||
43 | * @return \DateTime |
||
44 | */ |
||
45 | public function import($limit = 100, ProgressInterface $progress = null) |
||
69 | |||
70 | /** |
||
71 | * @param ReaderModelInterface[]|array $readerModels |
||
72 | * @param \DateTime $importDate |
||
73 | * @param ProgressInterface $progress |
||
74 | */ |
||
75 | protected function importModels(array $readerModels, \DateTime $importDate, ProgressInterface $progress) |
||
95 | |||
96 | /** |
||
97 | * @param ReaderModelInterface $readerModel |
||
98 | * @param \DateTime $importDate |
||
99 | * |
||
100 | * @return WriterModelInterface |
||
101 | */ |
||
102 | protected function importModel(ReaderModelInterface $readerModel, \DateTime $importDate) |
||
122 | |||
123 | /** |
||
124 | * @param ReaderModelInterface $readerModel |
||
125 | * @param string $action |
||
126 | */ |
||
127 | protected function modelInfo(ReaderModelInterface $readerModel, $action) |
||
134 | } |
||
135 |