1 | <?php |
||
40 | class Subject implements SubjectConfigurationInterface |
||
41 | { |
||
42 | |||
43 | /** |
||
44 | * The trait that provides parameter handling functionality. |
||
45 | * |
||
46 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ParamsTrait |
||
47 | */ |
||
48 | use ParamsTrait; |
||
49 | |||
50 | /** |
||
51 | * The subject's unique DI identifier. |
||
52 | * |
||
53 | * @var string |
||
54 | * @Type("string") |
||
55 | * @SerializedName("id") |
||
56 | */ |
||
57 | protected $id; |
||
58 | |||
59 | /** |
||
60 | * The file prefix for import files. |
||
61 | * |
||
62 | * @var string |
||
63 | * @Type("string") |
||
64 | */ |
||
65 | protected $prefix = 'magento-import'; |
||
66 | |||
67 | /** |
||
68 | * The file suffix for import files. |
||
69 | * |
||
70 | * @var string |
||
71 | * @Type("string") |
||
72 | */ |
||
73 | protected $suffix = 'csv'; |
||
74 | |||
75 | /** |
||
76 | * The array with the subject's observers. |
||
77 | * |
||
78 | * @var array |
||
79 | * @Type("array") |
||
80 | */ |
||
81 | protected $observers = array(); |
||
82 | |||
83 | /** |
||
84 | * The array with the subject's callbacks. |
||
85 | * |
||
86 | * @var array |
||
87 | * @Type("array<string, array>") |
||
88 | */ |
||
89 | protected $callbacks = array(); |
||
90 | |||
91 | /** |
||
92 | * A reference to the parent configuration instance. |
||
93 | * |
||
94 | * @var \TechDivision\Import\ConfigurationInterface |
||
95 | */ |
||
96 | protected $configuration; |
||
97 | |||
98 | /** |
||
99 | * The flag to signal that the subjects needs a OK file to be processed or not. |
||
100 | * |
||
101 | * @var boolean |
||
102 | * @Type("boolean") |
||
103 | * @SerializedName("ok-file-needed") |
||
104 | */ |
||
105 | protected $okFileNeeded = false; |
||
106 | |||
107 | /** |
||
108 | * The import adapter configuration instance. |
||
109 | * |
||
110 | * @var \TechDivision\Import\Configuration\Subject\ImportAdapterConfigurationInterface |
||
111 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\ImportAdapter") |
||
112 | * @SerializedName("import-adapter") |
||
113 | */ |
||
114 | protected $importAdapter; |
||
115 | |||
116 | /** |
||
117 | * The export adapter configuration instance. |
||
118 | * |
||
119 | * @var \TechDivision\Import\Configuration\Subject\ExportAdapterConfigurationInterface |
||
120 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\ExportAdapter") |
||
121 | * @SerializedName("export-adapter") |
||
122 | */ |
||
123 | protected $exportAdapter; |
||
124 | |||
125 | /** |
||
126 | * Lifecycle callback that will be invoked after deserialization. |
||
127 | * |
||
128 | * @return void |
||
129 | * @PostDeserialize |
||
130 | */ |
||
131 | public function postDeserialize() |
||
144 | |||
145 | /** |
||
146 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
147 | * |
||
148 | * @return string The multiple field delimiter character |
||
149 | */ |
||
150 | public function getMultipleFieldDelimiter() |
||
154 | |||
155 | /** |
||
156 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
157 | * |
||
158 | * @return string The multiple value delimiter character |
||
159 | */ |
||
160 | public function getMultipleValueDelimiter() |
||
164 | |||
165 | /** |
||
166 | * Return's the delimiter character to use, default value is comma (,). |
||
167 | * |
||
168 | * @return string The delimiter character |
||
169 | */ |
||
170 | public function getDelimiter() |
||
174 | |||
175 | /** |
||
176 | * The enclosure character to use, default value is double quotation ("). |
||
177 | * |
||
178 | * @return string The enclosure character |
||
179 | */ |
||
180 | public function getEnclosure() |
||
184 | |||
185 | /** |
||
186 | * The escape character to use, default value is backslash (\). |
||
187 | * |
||
188 | * @return string The escape character |
||
189 | */ |
||
190 | public function getEscape() |
||
194 | |||
195 | /** |
||
196 | * The file encoding of the CSV source file, default value is UTF-8. |
||
197 | * |
||
198 | * @return string The charset used by the CSV source file |
||
199 | */ |
||
200 | public function getFromCharset() |
||
204 | |||
205 | /** |
||
206 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
207 | * |
||
208 | * @return string The charset used by the CSV target file |
||
209 | */ |
||
210 | public function getToCharset() |
||
214 | |||
215 | /** |
||
216 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
217 | * |
||
218 | * @return string The file mode of the CSV target file |
||
219 | */ |
||
220 | public function getFileMode() |
||
224 | |||
225 | /** |
||
226 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
227 | * |
||
228 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
229 | */ |
||
230 | public function isStrictMode() |
||
234 | |||
235 | /** |
||
236 | * Return's the subject's source date format to use. |
||
237 | * |
||
238 | * @return string The source date format |
||
239 | */ |
||
240 | public function getSourceDateFormat() |
||
244 | |||
245 | /** |
||
246 | * Return's the source directory that has to be watched for new files. |
||
247 | * |
||
248 | * @return string The source directory |
||
249 | */ |
||
250 | public function getSourceDir() |
||
254 | |||
255 | /** |
||
256 | * Return's the target directory with the files that has been imported. |
||
257 | * |
||
258 | * @return string The target directory |
||
259 | */ |
||
260 | public function getTargetDir() |
||
264 | |||
265 | /** |
||
266 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
267 | * |
||
268 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
269 | */ |
||
270 | public function isDebugMode() |
||
274 | |||
275 | /** |
||
276 | * Return's the subject's unique DI identifier. |
||
277 | * |
||
278 | * @return string The subject's unique DI identifier |
||
279 | */ |
||
280 | public function getId() |
||
284 | |||
285 | /** |
||
286 | * Set's the reference to the configuration instance. |
||
287 | * |
||
288 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
289 | * |
||
290 | * @return void |
||
291 | */ |
||
292 | public function setConfiguration(ConfigurationInterface $configuration) |
||
296 | |||
297 | /** |
||
298 | * Return's the reference to the configuration instance. |
||
299 | * |
||
300 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
301 | */ |
||
302 | public function getConfiguration() |
||
306 | |||
307 | /** |
||
308 | * Set's the prefix for the import files. |
||
309 | * |
||
310 | * @param string $prefix The prefix |
||
311 | * |
||
312 | * @return void |
||
313 | */ |
||
314 | public function setPrefix($prefix) |
||
318 | |||
319 | /** |
||
320 | * Return's the prefix for the import files. |
||
321 | * |
||
322 | * @return string The prefix |
||
323 | */ |
||
324 | public function getPrefix() |
||
328 | |||
329 | /** |
||
330 | * Set's the suffix for the import files. |
||
331 | * |
||
332 | * @param string $suffix The suffix |
||
333 | * |
||
334 | * @return void |
||
335 | */ |
||
336 | public function setSuffix($suffix) |
||
340 | |||
341 | /** |
||
342 | * Return's the suffix for the import files. |
||
343 | * |
||
344 | * @return string The suffix |
||
345 | */ |
||
346 | public function getSuffix() |
||
350 | |||
351 | /** |
||
352 | * Return's the array with the subject's observers. |
||
353 | * |
||
354 | * @return array The subject's observers |
||
355 | */ |
||
356 | public function getObservers() |
||
360 | |||
361 | /** |
||
362 | * Return's the array with the subject's callbacks. |
||
363 | * |
||
364 | * @return array The subject's callbacks |
||
365 | */ |
||
366 | public function getCallbacks() |
||
370 | |||
371 | /** |
||
372 | * Set's the flag to signal that the an OK file is needed for the subject |
||
373 | * to be processed. |
||
374 | * |
||
375 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
376 | * |
||
377 | * @return void |
||
378 | */ |
||
379 | public function setOkFileNeeded($okFileNeeded) |
||
383 | |||
384 | /** |
||
385 | * Queries whether or not that the subject needs an OK file to be processed. |
||
386 | * |
||
387 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
388 | */ |
||
389 | public function isOkFileNeeded() |
||
393 | |||
394 | /** |
||
395 | * Return's the import adapter configuration instance. |
||
396 | * |
||
397 | * @return \TechDivision\Import\Subject\ImportAdapterConfigurationInterface The import adapter configuration instance |
||
398 | */ |
||
399 | public function getImportAdapter() |
||
403 | |||
404 | /** |
||
405 | * Return's the export adapter configuration instance. |
||
406 | * |
||
407 | * @return \TechDivision\Import\Subject\ExportAdapterConfigurationInterface The export adapter configuration instance |
||
408 | */ |
||
409 | public function getExportAdapter() |
||
413 | } |
||
414 |