1 | <?php |
||
41 | class Subject implements SubjectConfigurationInterface |
||
42 | { |
||
43 | |||
44 | /** |
||
45 | * The trait that provides parameter handling functionality. |
||
46 | * |
||
47 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ParamsTrait |
||
48 | */ |
||
49 | use ParamsTrait; |
||
50 | |||
51 | /** |
||
52 | * The subject's unique DI identifier. |
||
53 | * |
||
54 | * @var string |
||
55 | * @Type("string") |
||
56 | * @SerializedName("id") |
||
57 | */ |
||
58 | protected $id; |
||
59 | |||
60 | /** |
||
61 | * The file prefix for import files. |
||
62 | * |
||
63 | * @var string |
||
64 | * @Type("string") |
||
65 | */ |
||
66 | protected $prefix = 'magento-import'; |
||
67 | |||
68 | /** |
||
69 | * The file suffix for import files. |
||
70 | * |
||
71 | * @var string |
||
72 | * @Type("string") |
||
73 | */ |
||
74 | protected $suffix = 'csv'; |
||
75 | |||
76 | /** |
||
77 | * The array with the subject's observers. |
||
78 | * |
||
79 | * @var array |
||
80 | * @Type("array") |
||
81 | */ |
||
82 | protected $observers = array(); |
||
83 | |||
84 | /** |
||
85 | * The array with the subject's callbacks. |
||
86 | * |
||
87 | * @var array |
||
88 | * @Type("array<string, array>") |
||
89 | */ |
||
90 | protected $callbacks = array(); |
||
91 | |||
92 | /** |
||
93 | * The array with the subject's frontend input callbacks. |
||
94 | * |
||
95 | * @var array |
||
96 | * @Type("array<string, array>") |
||
97 | * @SerializedName("frontend-input-callbacks") |
||
98 | */ |
||
99 | protected $frontendInputCallbacks = array(); |
||
100 | |||
101 | /** |
||
102 | * A reference to the parent configuration instance. |
||
103 | * |
||
104 | * @var \TechDivision\Import\ConfigurationInterface |
||
105 | */ |
||
106 | protected $configuration; |
||
107 | |||
108 | /** |
||
109 | * The flag to signal that the subjects needs a OK file to be processed or not. |
||
110 | * |
||
111 | * @var boolean |
||
112 | * @Type("boolean") |
||
113 | * @SerializedName("ok-file-needed") |
||
114 | */ |
||
115 | protected $okFileNeeded = false; |
||
116 | |||
117 | /** |
||
118 | * The import adapter configuration instance. |
||
119 | * |
||
120 | * @var \TechDivision\Import\Configuration\Subject\ImportAdapterConfigurationInterface |
||
121 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\ImportAdapter") |
||
122 | * @SerializedName("import-adapter") |
||
123 | */ |
||
124 | protected $importAdapter; |
||
125 | |||
126 | /** |
||
127 | * The export adapter configuration instance. |
||
128 | * |
||
129 | * @var \TechDivision\Import\Configuration\Subject\ExportAdapterConfigurationInterface |
||
130 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\ExportAdapter") |
||
131 | * @SerializedName("export-adapter") |
||
132 | */ |
||
133 | protected $exportAdapter; |
||
134 | |||
135 | /** |
||
136 | * The filesystem adapter configuration instance. |
||
137 | * |
||
138 | * @var \TechDivision\Import\Configuration\Subject\FilesystemAdapterConfigurationInterface |
||
139 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\FilesystemAdapter") |
||
140 | * @SerializedName("filesystem-adapter") |
||
141 | */ |
||
142 | protected $filesystemAdapter; |
||
143 | |||
144 | /** |
||
145 | * Lifecycle callback that will be invoked after deserialization. |
||
146 | * |
||
147 | * @return void |
||
148 | * @PostDeserialize |
||
149 | */ |
||
150 | public function postDeserialize() |
||
168 | |||
169 | /** |
||
170 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
171 | * |
||
172 | * @return string The multiple field delimiter character |
||
173 | */ |
||
174 | public function getMultipleFieldDelimiter() |
||
178 | |||
179 | /** |
||
180 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
181 | * |
||
182 | * @return string The multiple value delimiter character |
||
183 | */ |
||
184 | public function getMultipleValueDelimiter() |
||
188 | |||
189 | /** |
||
190 | * Return's the delimiter character to use, default value is comma (,). |
||
191 | * |
||
192 | * @return string The delimiter character |
||
193 | */ |
||
194 | public function getDelimiter() |
||
198 | |||
199 | /** |
||
200 | * The enclosure character to use, default value is double quotation ("). |
||
201 | * |
||
202 | * @return string The enclosure character |
||
203 | */ |
||
204 | public function getEnclosure() |
||
208 | |||
209 | /** |
||
210 | * The escape character to use, default value is backslash (\). |
||
211 | * |
||
212 | * @return string The escape character |
||
213 | */ |
||
214 | public function getEscape() |
||
218 | |||
219 | /** |
||
220 | * The file encoding of the CSV source file, default value is UTF-8. |
||
221 | * |
||
222 | * @return string The charset used by the CSV source file |
||
223 | */ |
||
224 | public function getFromCharset() |
||
228 | |||
229 | /** |
||
230 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
231 | * |
||
232 | * @return string The charset used by the CSV target file |
||
233 | */ |
||
234 | public function getToCharset() |
||
238 | |||
239 | /** |
||
240 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
241 | * |
||
242 | * @return string The file mode of the CSV target file |
||
243 | */ |
||
244 | public function getFileMode() |
||
248 | |||
249 | /** |
||
250 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
251 | * |
||
252 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
253 | */ |
||
254 | public function isStrictMode() |
||
258 | |||
259 | /** |
||
260 | * Return's the subject's source date format to use. |
||
261 | * |
||
262 | * @return string The source date format |
||
263 | */ |
||
264 | public function getSourceDateFormat() |
||
268 | |||
269 | /** |
||
270 | * Return's the source directory that has to be watched for new files. |
||
271 | * |
||
272 | * @return string The source directory |
||
273 | */ |
||
274 | public function getSourceDir() |
||
278 | |||
279 | /** |
||
280 | * Return's the target directory with the files that has been imported. |
||
281 | * |
||
282 | * @return string The target directory |
||
283 | */ |
||
284 | public function getTargetDir() |
||
288 | |||
289 | /** |
||
290 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
291 | * |
||
292 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
293 | */ |
||
294 | public function isDebugMode() |
||
298 | |||
299 | /** |
||
300 | * Return's the subject's unique DI identifier. |
||
301 | * |
||
302 | * @return string The subject's unique DI identifier |
||
303 | */ |
||
304 | public function getId() |
||
308 | |||
309 | /** |
||
310 | * Set's the reference to the configuration instance. |
||
311 | * |
||
312 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
313 | * |
||
314 | * @return void |
||
315 | */ |
||
316 | public function setConfiguration(ConfigurationInterface $configuration) |
||
320 | |||
321 | /** |
||
322 | * Return's the reference to the configuration instance. |
||
323 | * |
||
324 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
325 | */ |
||
326 | public function getConfiguration() |
||
330 | |||
331 | /** |
||
332 | * Set's the prefix for the import files. |
||
333 | * |
||
334 | * @param string $prefix The prefix |
||
335 | * |
||
336 | * @return void |
||
337 | */ |
||
338 | public function setPrefix($prefix) |
||
342 | |||
343 | /** |
||
344 | * Return's the prefix for the import files. |
||
345 | * |
||
346 | * @return string The prefix |
||
347 | */ |
||
348 | public function getPrefix() |
||
352 | |||
353 | /** |
||
354 | * Set's the suffix for the import files. |
||
355 | * |
||
356 | * @param string $suffix The suffix |
||
357 | * |
||
358 | * @return void |
||
359 | */ |
||
360 | public function setSuffix($suffix) |
||
364 | |||
365 | /** |
||
366 | * Return's the suffix for the import files. |
||
367 | * |
||
368 | * @return string The suffix |
||
369 | */ |
||
370 | public function getSuffix() |
||
374 | |||
375 | /** |
||
376 | * Return's the array with the subject's observers. |
||
377 | * |
||
378 | * @return array The subject's observers |
||
379 | */ |
||
380 | public function getObservers() |
||
384 | |||
385 | /** |
||
386 | * Return's the array with the subject's callbacks. |
||
387 | * |
||
388 | * @return array The subject's callbacks |
||
389 | */ |
||
390 | public function getCallbacks() |
||
394 | |||
395 | /** |
||
396 | * Return's the array with the subject's frontend input callbacks. |
||
397 | * |
||
398 | * @return array The subject's frontend input callbacks |
||
399 | */ |
||
400 | public function getFrontendInputCallbacks() |
||
404 | |||
405 | /** |
||
406 | * Set's the flag to signal that the an OK file is needed for the subject |
||
407 | * to be processed. |
||
408 | * |
||
409 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
410 | * |
||
411 | * @return void |
||
412 | */ |
||
413 | public function setOkFileNeeded($okFileNeeded) |
||
417 | |||
418 | /** |
||
419 | * Queries whether or not that the subject needs an OK file to be processed. |
||
420 | * |
||
421 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
422 | */ |
||
423 | public function isOkFileNeeded() |
||
427 | |||
428 | /** |
||
429 | * Return's the import adapter configuration instance. |
||
430 | * |
||
431 | * @return \TechDivision\Import\Configuration\Subject\ImportAdapterConfigurationInterface The import adapter configuration instance |
||
432 | */ |
||
433 | public function getImportAdapter() |
||
437 | |||
438 | /** |
||
439 | * Return's the export adapter configuration instance. |
||
440 | * |
||
441 | * @return \TechDivision\Import\Configuration\Subject\ExportAdapterConfigurationInterface The export adapter configuration instance |
||
442 | */ |
||
443 | public function getExportAdapter() |
||
447 | |||
448 | /** |
||
449 | * Return's the filesystem adapter configuration instance. |
||
450 | * |
||
451 | * @return \TechDivision\Import\Configuration\Subject\FilesystemAdapterConfigurationInterface The filesystem adapter configuration instance |
||
452 | */ |
||
453 | public function getFilesystemAdapter() |
||
457 | |||
458 | /** |
||
459 | * The array with the subject's custom header mappings. |
||
460 | * |
||
461 | * @return array The custom header mappings |
||
462 | */ |
||
463 | public function getHeaderMappings() |
||
467 | |||
468 | /** |
||
469 | * The array with the subject's custom image types. |
||
470 | * |
||
471 | * @return array The custom image types |
||
472 | */ |
||
473 | public function getImageTypes() |
||
477 | } |
||
478 |