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 | * A reference to the parent configuration instance. |
||
94 | * |
||
95 | * @var \TechDivision\Import\ConfigurationInterface |
||
96 | */ |
||
97 | protected $configuration; |
||
98 | |||
99 | /** |
||
100 | * The flag to signal that the subjects needs a OK file to be processed or not. |
||
101 | * |
||
102 | * @var boolean |
||
103 | * @Type("boolean") |
||
104 | * @SerializedName("ok-file-needed") |
||
105 | */ |
||
106 | protected $okFileNeeded = false; |
||
107 | |||
108 | /** |
||
109 | * The import adapter configuration instance. |
||
110 | * |
||
111 | * @var \TechDivision\Import\Configuration\Subject\ImportAdapterConfigurationInterface |
||
112 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\ImportAdapter") |
||
113 | * @SerializedName("import-adapter") |
||
114 | */ |
||
115 | protected $importAdapter; |
||
116 | |||
117 | /** |
||
118 | * The export adapter configuration instance. |
||
119 | * |
||
120 | * @var \TechDivision\Import\Configuration\Subject\ExportAdapterConfigurationInterface |
||
121 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\ExportAdapter") |
||
122 | * @SerializedName("export-adapter") |
||
123 | */ |
||
124 | protected $exportAdapter; |
||
125 | |||
126 | /** |
||
127 | * The filesystem adapter configuration instance. |
||
128 | * |
||
129 | * @var \TechDivision\Import\Configuration\Subject\FilesystemAdapterConfigurationInterface |
||
130 | * @Type("TechDivision\Import\Configuration\Jms\Configuration\Subject\FilesystemAdapter") |
||
131 | * @SerializedName("filesystem-adapter") |
||
132 | */ |
||
133 | protected $filesystemAdapter; |
||
134 | |||
135 | /** |
||
136 | * The array with the custom header mappings. |
||
137 | * |
||
138 | * @var array |
||
139 | * @Type("array") |
||
140 | * @SerializedName("header-mappings") |
||
141 | */ |
||
142 | protected $headerMappings = array(); |
||
143 | |||
144 | /** |
||
145 | * The array with the custom image types. |
||
146 | * |
||
147 | * @var array |
||
148 | * @Type("array") |
||
149 | * @SerializedName("image-types") |
||
150 | */ |
||
151 | protected $imageTypes = array(); |
||
152 | |||
153 | /** |
||
154 | * Lifecycle callback that will be invoked after deserialization. |
||
155 | * |
||
156 | * @return void |
||
157 | * @PostDeserialize |
||
158 | */ |
||
159 | public function postDeserialize() |
||
177 | |||
178 | /** |
||
179 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
180 | * |
||
181 | * @return string The multiple field delimiter character |
||
182 | */ |
||
183 | public function getMultipleFieldDelimiter() |
||
187 | |||
188 | /** |
||
189 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
190 | * |
||
191 | * @return string The multiple value delimiter character |
||
192 | */ |
||
193 | public function getMultipleValueDelimiter() |
||
197 | |||
198 | /** |
||
199 | * Return's the delimiter character to use, default value is comma (,). |
||
200 | * |
||
201 | * @return string The delimiter character |
||
202 | */ |
||
203 | public function getDelimiter() |
||
207 | |||
208 | /** |
||
209 | * The enclosure character to use, default value is double quotation ("). |
||
210 | * |
||
211 | * @return string The enclosure character |
||
212 | */ |
||
213 | public function getEnclosure() |
||
217 | |||
218 | /** |
||
219 | * The escape character to use, default value is backslash (\). |
||
220 | * |
||
221 | * @return string The escape character |
||
222 | */ |
||
223 | public function getEscape() |
||
227 | |||
228 | /** |
||
229 | * The file encoding of the CSV source file, default value is UTF-8. |
||
230 | * |
||
231 | * @return string The charset used by the CSV source file |
||
232 | */ |
||
233 | public function getFromCharset() |
||
237 | |||
238 | /** |
||
239 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
240 | * |
||
241 | * @return string The charset used by the CSV target file |
||
242 | */ |
||
243 | public function getToCharset() |
||
247 | |||
248 | /** |
||
249 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
250 | * |
||
251 | * @return string The file mode of the CSV target file |
||
252 | */ |
||
253 | public function getFileMode() |
||
257 | |||
258 | /** |
||
259 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
260 | * |
||
261 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
262 | */ |
||
263 | public function isStrictMode() |
||
267 | |||
268 | /** |
||
269 | * Return's the subject's source date format to use. |
||
270 | * |
||
271 | * @return string The source date format |
||
272 | */ |
||
273 | public function getSourceDateFormat() |
||
277 | |||
278 | /** |
||
279 | * Return's the source directory that has to be watched for new files. |
||
280 | * |
||
281 | * @return string The source directory |
||
282 | */ |
||
283 | public function getSourceDir() |
||
287 | |||
288 | /** |
||
289 | * Return's the target directory with the files that has been imported. |
||
290 | * |
||
291 | * @return string The target directory |
||
292 | */ |
||
293 | public function getTargetDir() |
||
297 | |||
298 | /** |
||
299 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
300 | * |
||
301 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
302 | */ |
||
303 | public function isDebugMode() |
||
307 | |||
308 | /** |
||
309 | * Return's the subject's unique DI identifier. |
||
310 | * |
||
311 | * @return string The subject's unique DI identifier |
||
312 | */ |
||
313 | public function getId() |
||
317 | |||
318 | /** |
||
319 | * Set's the reference to the configuration instance. |
||
320 | * |
||
321 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
322 | * |
||
323 | * @return void |
||
324 | */ |
||
325 | public function setConfiguration(ConfigurationInterface $configuration) |
||
329 | |||
330 | /** |
||
331 | * Return's the reference to the configuration instance. |
||
332 | * |
||
333 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
334 | */ |
||
335 | public function getConfiguration() |
||
339 | |||
340 | /** |
||
341 | * Set's the prefix for the import files. |
||
342 | * |
||
343 | * @param string $prefix The prefix |
||
344 | * |
||
345 | * @return void |
||
346 | */ |
||
347 | public function setPrefix($prefix) |
||
351 | |||
352 | /** |
||
353 | * Return's the prefix for the import files. |
||
354 | * |
||
355 | * @return string The prefix |
||
356 | */ |
||
357 | public function getPrefix() |
||
361 | |||
362 | /** |
||
363 | * Set's the suffix for the import files. |
||
364 | * |
||
365 | * @param string $suffix The suffix |
||
366 | * |
||
367 | * @return void |
||
368 | */ |
||
369 | public function setSuffix($suffix) |
||
373 | |||
374 | /** |
||
375 | * Return's the suffix for the import files. |
||
376 | * |
||
377 | * @return string The suffix |
||
378 | */ |
||
379 | public function getSuffix() |
||
383 | |||
384 | /** |
||
385 | * Return's the array with the subject's observers. |
||
386 | * |
||
387 | * @return array The subject's observers |
||
388 | */ |
||
389 | public function getObservers() |
||
393 | |||
394 | /** |
||
395 | * Return's the array with the subject's callbacks. |
||
396 | * |
||
397 | * @return array The subject's callbacks |
||
398 | */ |
||
399 | public function getCallbacks() |
||
403 | |||
404 | /** |
||
405 | * Set's the flag to signal that the an OK file is needed for the subject |
||
406 | * to be processed. |
||
407 | * |
||
408 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
409 | * |
||
410 | * @return void |
||
411 | */ |
||
412 | public function setOkFileNeeded($okFileNeeded) |
||
416 | |||
417 | /** |
||
418 | * Queries whether or not that the subject needs an OK file to be processed. |
||
419 | * |
||
420 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
421 | */ |
||
422 | public function isOkFileNeeded() |
||
426 | |||
427 | /** |
||
428 | * Return's the import adapter configuration instance. |
||
429 | * |
||
430 | * @return \TechDivision\Import\Configuration\Subject\ImportAdapterConfigurationInterface The import adapter configuration instance |
||
431 | */ |
||
432 | public function getImportAdapter() |
||
436 | |||
437 | /** |
||
438 | * Return's the export adapter configuration instance. |
||
439 | * |
||
440 | * @return \TechDivision\Import\Configuration\Subject\ExportAdapterConfigurationInterface The export adapter configuration instance |
||
441 | */ |
||
442 | public function getExportAdapter() |
||
446 | |||
447 | /** |
||
448 | * Return's the filesystem adapter configuration instance. |
||
449 | * |
||
450 | * @return \TechDivision\Import\Configuration\Subject\FilesystemAdapterConfigurationInterface The filesystem adapter configuration instance |
||
451 | */ |
||
452 | public function getFilesystemAdapter() |
||
456 | |||
457 | /** |
||
458 | * The array with the subject's custom header mappings. |
||
459 | * |
||
460 | * @return array The custom header mappings |
||
461 | */ |
||
462 | public function getHeaderMappings() |
||
476 | |||
477 | /** |
||
478 | * The array with the subject's custom image types. |
||
479 | * |
||
480 | * @return array The custom image types |
||
481 | */ |
||
482 | public function getImageTypes() |
||
496 | } |
||
497 |