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 | * Lifecycle callback that will be invoked after deserialization. |
||
137 | * |
||
138 | * @return void |
||
139 | * @PostDeserialize |
||
140 | */ |
||
141 | public function postDeserialize() |
||
159 | |||
160 | /** |
||
161 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
162 | * |
||
163 | * @return string The multiple field delimiter character |
||
164 | */ |
||
165 | public function getMultipleFieldDelimiter() |
||
169 | |||
170 | /** |
||
171 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
172 | * |
||
173 | * @return string The multiple value delimiter character |
||
174 | */ |
||
175 | public function getMultipleValueDelimiter() |
||
179 | |||
180 | /** |
||
181 | * Return's the delimiter character to use, default value is comma (,). |
||
182 | * |
||
183 | * @return string The delimiter character |
||
184 | */ |
||
185 | public function getDelimiter() |
||
189 | |||
190 | /** |
||
191 | * The enclosure character to use, default value is double quotation ("). |
||
192 | * |
||
193 | * @return string The enclosure character |
||
194 | */ |
||
195 | public function getEnclosure() |
||
199 | |||
200 | /** |
||
201 | * The escape character to use, default value is backslash (\). |
||
202 | * |
||
203 | * @return string The escape character |
||
204 | */ |
||
205 | public function getEscape() |
||
209 | |||
210 | /** |
||
211 | * The file encoding of the CSV source file, default value is UTF-8. |
||
212 | * |
||
213 | * @return string The charset used by the CSV source file |
||
214 | */ |
||
215 | public function getFromCharset() |
||
219 | |||
220 | /** |
||
221 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
222 | * |
||
223 | * @return string The charset used by the CSV target file |
||
224 | */ |
||
225 | public function getToCharset() |
||
229 | |||
230 | /** |
||
231 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
232 | * |
||
233 | * @return string The file mode of the CSV target file |
||
234 | */ |
||
235 | public function getFileMode() |
||
239 | |||
240 | /** |
||
241 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
242 | * |
||
243 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
244 | */ |
||
245 | public function isStrictMode() |
||
249 | |||
250 | /** |
||
251 | * Return's the subject's source date format to use. |
||
252 | * |
||
253 | * @return string The source date format |
||
254 | */ |
||
255 | public function getSourceDateFormat() |
||
259 | |||
260 | /** |
||
261 | * Return's the source directory that has to be watched for new files. |
||
262 | * |
||
263 | * @return string The source directory |
||
264 | */ |
||
265 | public function getSourceDir() |
||
269 | |||
270 | /** |
||
271 | * Return's the target directory with the files that has been imported. |
||
272 | * |
||
273 | * @return string The target directory |
||
274 | */ |
||
275 | public function getTargetDir() |
||
279 | |||
280 | /** |
||
281 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
282 | * |
||
283 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
284 | */ |
||
285 | public function isDebugMode() |
||
289 | |||
290 | /** |
||
291 | * Return's the subject's unique DI identifier. |
||
292 | * |
||
293 | * @return string The subject's unique DI identifier |
||
294 | */ |
||
295 | public function getId() |
||
299 | |||
300 | /** |
||
301 | * Set's the reference to the configuration instance. |
||
302 | * |
||
303 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
304 | * |
||
305 | * @return void |
||
306 | */ |
||
307 | public function setConfiguration(ConfigurationInterface $configuration) |
||
311 | |||
312 | /** |
||
313 | * Return's the reference to the configuration instance. |
||
314 | * |
||
315 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
316 | */ |
||
317 | public function getConfiguration() |
||
321 | |||
322 | /** |
||
323 | * Set's the prefix for the import files. |
||
324 | * |
||
325 | * @param string $prefix The prefix |
||
326 | * |
||
327 | * @return void |
||
328 | */ |
||
329 | public function setPrefix($prefix) |
||
333 | |||
334 | /** |
||
335 | * Return's the prefix for the import files. |
||
336 | * |
||
337 | * @return string The prefix |
||
338 | */ |
||
339 | public function getPrefix() |
||
343 | |||
344 | /** |
||
345 | * Set's the suffix for the import files. |
||
346 | * |
||
347 | * @param string $suffix The suffix |
||
348 | * |
||
349 | * @return void |
||
350 | */ |
||
351 | public function setSuffix($suffix) |
||
355 | |||
356 | /** |
||
357 | * Return's the suffix for the import files. |
||
358 | * |
||
359 | * @return string The suffix |
||
360 | */ |
||
361 | public function getSuffix() |
||
365 | |||
366 | /** |
||
367 | * Return's the array with the subject's observers. |
||
368 | * |
||
369 | * @return array The subject's observers |
||
370 | */ |
||
371 | public function getObservers() |
||
375 | |||
376 | /** |
||
377 | * Return's the array with the subject's callbacks. |
||
378 | * |
||
379 | * @return array The subject's callbacks |
||
380 | */ |
||
381 | public function getCallbacks() |
||
385 | |||
386 | /** |
||
387 | * Set's the flag to signal that the an OK file is needed for the subject |
||
388 | * to be processed. |
||
389 | * |
||
390 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
391 | * |
||
392 | * @return void |
||
393 | */ |
||
394 | public function setOkFileNeeded($okFileNeeded) |
||
398 | |||
399 | /** |
||
400 | * Queries whether or not that the subject needs an OK file to be processed. |
||
401 | * |
||
402 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
403 | */ |
||
404 | public function isOkFileNeeded() |
||
408 | |||
409 | /** |
||
410 | * Return's the import adapter configuration instance. |
||
411 | * |
||
412 | * @return \TechDivision\Import\Configuration\Subject\ImportAdapterConfigurationInterface The import adapter configuration instance |
||
413 | */ |
||
414 | public function getImportAdapter() |
||
418 | |||
419 | /** |
||
420 | * Return's the export adapter configuration instance. |
||
421 | * |
||
422 | * @return \TechDivision\Import\Configuration\Subject\ExportAdapterConfigurationInterface The export adapter configuration instance |
||
423 | */ |
||
424 | public function getExportAdapter() |
||
428 | |||
429 | /** |
||
430 | * Return's the filesystem adapter configuration instance. |
||
431 | * |
||
432 | * @return \TechDivision\Import\Configuration\Subject\FilesystemAdapterConfigurationInterface The filesystem adapter configuration instance |
||
433 | */ |
||
434 | public function getFilesystemAdapter() |
||
438 | } |
||
439 |