1 | <?php |
||
37 | class Subject implements SubjectInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The subject's class name. |
||
42 | * |
||
43 | * @var string |
||
44 | * @Type("string") |
||
45 | * @SerializedName("class-name") |
||
46 | */ |
||
47 | protected $className; |
||
48 | |||
49 | /** |
||
50 | * The subject's processor type to use. |
||
51 | * |
||
52 | * @var string |
||
53 | * @Type("string") |
||
54 | * @SerializedName("processor-factory") |
||
55 | */ |
||
56 | protected $processorFactory; |
||
57 | |||
58 | /** |
||
59 | * The subject's utility class with the SQL statements to use. |
||
60 | * |
||
61 | * @var string |
||
62 | * @Type("string") |
||
63 | * @SerializedName("utility-class-name") |
||
64 | */ |
||
65 | protected $utilityClassName; |
||
66 | |||
67 | /** |
||
68 | * The file prefix for import files. |
||
69 | * |
||
70 | * @var string |
||
71 | * @Type("string") |
||
72 | */ |
||
73 | protected $prefix = 'magento-import'; |
||
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 | * The array with the subject's params. |
||
93 | * |
||
94 | * @var array |
||
95 | * @Type("array") |
||
96 | */ |
||
97 | protected $params = array(); |
||
98 | |||
99 | /** |
||
100 | * A reference to the parent configuration instance. |
||
101 | * |
||
102 | * @var \TechDivision\Import\ConfigurationInterface |
||
103 | */ |
||
104 | protected $configuration; |
||
105 | |||
106 | /** |
||
107 | * The flag to signal that the subjects needs a OK file to be processed or not. |
||
108 | * |
||
109 | * @var boolean |
||
110 | * @Type("boolean") |
||
111 | * @SerializedName("ok-file-needed") |
||
112 | */ |
||
113 | protected $okFileNeeded = false; |
||
114 | |||
115 | /** |
||
116 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
117 | * |
||
118 | * @return string The multiple field delimiter character |
||
119 | */ |
||
120 | public function getMultipleFieldDelimiter() |
||
124 | |||
125 | /** |
||
126 | * Return's the delimiter character to use, default value is comma (,). |
||
127 | * |
||
128 | * @return string The delimiter character |
||
129 | */ |
||
130 | public function getDelimiter() |
||
134 | |||
135 | /** |
||
136 | * The enclosure character to use, default value is double quotation ("). |
||
137 | * |
||
138 | * @return string The enclosure character |
||
139 | */ |
||
140 | public function getEnclosure() |
||
144 | |||
145 | /** |
||
146 | * The escape character to use, default value is backslash (\). |
||
147 | * |
||
148 | * @return string The escape character |
||
149 | */ |
||
150 | public function getEscape() |
||
154 | |||
155 | /** |
||
156 | * The file encoding of the CSV source file, default value is UTF-8. |
||
157 | * |
||
158 | * @return string The charset used by the CSV source file |
||
159 | */ |
||
160 | public function getFromCharset() |
||
164 | |||
165 | /** |
||
166 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
167 | * |
||
168 | * @return string The charset used by the CSV target file |
||
169 | */ |
||
170 | public function getToCharset() |
||
174 | |||
175 | /** |
||
176 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
177 | * |
||
178 | * @return string The file mode of the CSV target file |
||
179 | */ |
||
180 | public function getFileMode() |
||
184 | |||
185 | /** |
||
186 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
187 | * |
||
188 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
189 | */ |
||
190 | public function isStrictMode() |
||
194 | |||
195 | /** |
||
196 | * Return's the subject's source date format to use. |
||
197 | * |
||
198 | * @return string The source date format |
||
199 | */ |
||
200 | public function getSourceDateFormat() |
||
204 | |||
205 | /** |
||
206 | * Return's the source directory that has to be watched for new files. |
||
207 | * |
||
208 | * @return string The source directory |
||
209 | */ |
||
210 | public function getSourceDir() |
||
214 | |||
215 | /** |
||
216 | * Return's the target directory with the files that has been imported. |
||
217 | * |
||
218 | * @return string The target directory |
||
219 | */ |
||
220 | public function getTargetDir() |
||
224 | |||
225 | /** |
||
226 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
227 | * |
||
228 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
229 | */ |
||
230 | public function isDebugMode() |
||
234 | |||
235 | /** |
||
236 | * Return's the subject's class name. |
||
237 | * |
||
238 | * @return string The subject's class name |
||
239 | */ |
||
240 | public function getClassName() |
||
244 | |||
245 | /** |
||
246 | * Return's the subject's processor factory type to use. |
||
247 | * |
||
248 | * @return string The subject's processor factory type |
||
249 | */ |
||
250 | public function getProcessorFactory() |
||
254 | |||
255 | /** |
||
256 | * Return's the utility class with the SQL statements to use. |
||
257 | * |
||
258 | * @return string The utility class name |
||
259 | */ |
||
260 | public function getUtilityClassName() |
||
264 | |||
265 | /** |
||
266 | * Return's the array with the params. |
||
267 | * |
||
268 | * @return array The params |
||
269 | */ |
||
270 | public function getParams() |
||
277 | |||
278 | /** |
||
279 | * Query whether or not the param with the passed name exists. |
||
280 | * |
||
281 | * @param string $name The name of the param to be queried |
||
282 | * |
||
283 | * @return boolean TRUE if the requested param exists, else FALSE |
||
284 | */ |
||
285 | public function hasParam($name) |
||
289 | |||
290 | /** |
||
291 | * Return's the param with the passed name. |
||
292 | * |
||
293 | * @param string $name The name of the param to return |
||
294 | * @param mixed $defaultValue The default value if the param doesn't exists |
||
295 | * |
||
296 | * @return string The requested param |
||
297 | * @throws \Exception Is thrown, if the requested param is not available |
||
298 | */ |
||
299 | public function getParam($name, $defaultValue = null) |
||
315 | |||
316 | /** |
||
317 | * Set's the reference to the configuration instance. |
||
318 | * |
||
319 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
320 | * |
||
321 | * @return void |
||
322 | */ |
||
323 | public function setConfiguration(ConfigurationInterface $configuration) |
||
327 | |||
328 | /** |
||
329 | * Return's the reference to the configuration instance. |
||
330 | * |
||
331 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
332 | */ |
||
333 | public function getConfiguration() |
||
337 | |||
338 | /** |
||
339 | * Set's the prefix for the import files. |
||
340 | * |
||
341 | * @param string $prefix The prefix |
||
342 | * |
||
343 | * @return void |
||
344 | */ |
||
345 | public function setPrefix($prefix) |
||
349 | |||
350 | /** |
||
351 | * Return's the prefix for the import files. |
||
352 | * |
||
353 | * @return string The prefix |
||
354 | */ |
||
355 | public function getPrefix() |
||
359 | |||
360 | /** |
||
361 | * Return's the array with the subject's observers. |
||
362 | * |
||
363 | * @return array The subject's observers |
||
364 | */ |
||
365 | public function getObservers() |
||
369 | |||
370 | /** |
||
371 | * Return's the array with the subject's callbacks. |
||
372 | * |
||
373 | * @return array The subject's callbacks |
||
374 | */ |
||
375 | public function getCallbacks() |
||
379 | |||
380 | /** |
||
381 | * Set's the flag to signal that the an OK file is needed for the subject |
||
382 | * to be processed. |
||
383 | * |
||
384 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
385 | * |
||
386 | * @return void |
||
387 | */ |
||
388 | public function setOkFileNeeded($okFileNeeded) |
||
392 | |||
393 | /** |
||
394 | * Queries whether or not that the subject needs an OK file to be processed. |
||
395 | * |
||
396 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
397 | */ |
||
398 | public function isOkFileNeeded() |
||
402 | } |
||
403 |