1 | <?php |
||
11 | class Importer implements ImporterInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var StorageInterface |
||
15 | */ |
||
16 | private $sourceStorage; |
||
17 | |||
18 | /** |
||
19 | * @var StorageInterface |
||
20 | */ |
||
21 | private $targetStorage; |
||
22 | |||
23 | /** |
||
24 | * @var ValidationInterface |
||
25 | */ |
||
26 | private $validation; |
||
27 | |||
28 | /** |
||
29 | * @var Transformation |
||
30 | */ |
||
31 | private $transformation; |
||
32 | |||
33 | /** |
||
34 | * @var Filters |
||
35 | */ |
||
36 | private $filters; |
||
37 | |||
38 | private $context; |
||
39 | |||
40 | /** |
||
41 | * @return \Mathielen\ImportEngine\Importer\Importer |
||
42 | */ |
||
43 | 21 | public static function build(StorageInterface $targetStorage) |
|
47 | |||
48 | 21 | public function __construct(StorageInterface $targetStorage) |
|
56 | |||
57 | public function setContext($context) |
||
61 | |||
62 | 1 | public function getContext() |
|
66 | |||
67 | /** |
||
68 | * @return StorageInterface |
||
69 | */ |
||
70 | 11 | public function targetStorage() |
|
74 | |||
75 | /** |
||
76 | * @return ValidationInterface |
||
77 | */ |
||
78 | 21 | public function validation(ValidationInterface $validation = null) |
|
79 | { |
||
80 | 21 | if ($validation) { |
|
81 | 21 | $this->validation = $validation; |
|
82 | } |
||
83 | |||
84 | 21 | return $this->validation; |
|
85 | } |
||
86 | |||
87 | /** |
||
88 | * @return \Mathielen\ImportEngine\Transformation\Transformation |
||
89 | */ |
||
90 | 21 | public function transformation(Transformation $transformation = null) |
|
91 | { |
||
92 | 21 | if ($transformation) { |
|
93 | 21 | $this->transformation = $transformation; |
|
94 | } |
||
95 | |||
96 | 21 | return $this->transformation; |
|
97 | } |
||
98 | |||
99 | /** |
||
100 | * @return \Mathielen\ImportEngine\Filter\Filters |
||
101 | */ |
||
102 | 21 | public function filters(Filters $filters = null) |
|
103 | { |
||
104 | 21 | if ($filters) { |
|
105 | 21 | $this->filters = $filters; |
|
106 | } |
||
107 | |||
108 | 21 | return $this->filters; |
|
109 | } |
||
110 | |||
111 | /** |
||
112 | * @return StorageInterface |
||
113 | */ |
||
114 | 1 | public function getSourceStorage() |
|
118 | |||
119 | /** |
||
120 | * @return \Mathielen\ImportEngine\Importer\Importer |
||
121 | */ |
||
122 | 1 | public function setSourceStorage(StorageInterface $sourceStorage) |
|
128 | } |
||
129 |