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) |
||
66 | |||
67 | /** |
||
68 | * @param ProgressInterface|null $progress |
||
69 | * |
||
70 | * @return ProgressInterface |
||
71 | */ |
||
72 | protected function getProgress(ProgressInterface $progress = null) |
||
80 | |||
81 | /** |
||
82 | * @param ReaderModelInterface[]|array $readerModels |
||
83 | * @param \DateTime $importDate |
||
84 | * @param ProgressInterface $progress |
||
85 | */ |
||
86 | protected function importModels(array $readerModels, \DateTime $importDate, ProgressInterface $progress) |
||
106 | |||
107 | /** |
||
108 | * @param ReaderModelInterface $readerModel |
||
109 | * @param \DateTime $importDate |
||
110 | * |
||
111 | * @return WriterModelInterface |
||
112 | */ |
||
113 | protected function importModel(ReaderModelInterface $readerModel, \DateTime $importDate) |
||
133 | |||
134 | /** |
||
135 | * @param ReaderModelInterface $readerModel |
||
136 | * @param string $action |
||
137 | */ |
||
138 | protected function modelInfo(ReaderModelInterface $readerModel, $action) |
||
145 | } |
||
146 |