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 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
108 | * |
||
109 | * @return string The multiple field delimiter character |
||
110 | */ |
||
111 | public function getMultipleFieldDelimiter() |
||
115 | |||
116 | /** |
||
117 | * Return's the delimiter character to use, default value is comma (,). |
||
118 | * |
||
119 | * @return string The delimiter character |
||
120 | */ |
||
121 | public function getDelimiter() |
||
125 | |||
126 | /** |
||
127 | * The enclosure character to use, default value is double quotation ("). |
||
128 | * |
||
129 | * @return string The enclosure character |
||
130 | */ |
||
131 | public function getEnclosure() |
||
135 | |||
136 | /** |
||
137 | * The escape character to use, default value is backslash (\). |
||
138 | * |
||
139 | * @return string The escape character |
||
140 | */ |
||
141 | public function getEscape() |
||
145 | |||
146 | /** |
||
147 | * The file encoding of the CSV source file, default value is UTF-8. |
||
148 | * |
||
149 | * @return string The charset used by the CSV source file |
||
150 | */ |
||
151 | public function getFromCharset() |
||
155 | |||
156 | /** |
||
157 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
158 | * |
||
159 | * @return string The charset used by the CSV target file |
||
160 | */ |
||
161 | public function getToCharset() |
||
165 | |||
166 | /** |
||
167 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
168 | * |
||
169 | * @return string The file mode of the CSV target file |
||
170 | */ |
||
171 | public function getFileMode() |
||
175 | |||
176 | /** |
||
177 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
178 | * |
||
179 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
180 | */ |
||
181 | public function isStrictMode() |
||
185 | |||
186 | /** |
||
187 | * Return's the subject's source date format to use. |
||
188 | * |
||
189 | * @return string The source date format |
||
190 | */ |
||
191 | public function getSourceDateFormat() |
||
195 | |||
196 | /** |
||
197 | * Return's the source directory that has to be watched for new files. |
||
198 | * |
||
199 | * @return string The source directory |
||
200 | */ |
||
201 | public function getSourceDir() |
||
205 | |||
206 | /** |
||
207 | * Return's the target directory with the files that has been imported. |
||
208 | * |
||
209 | * @return string The target directory |
||
210 | */ |
||
211 | public function getTargetDir() |
||
215 | |||
216 | /** |
||
217 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
218 | * |
||
219 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
220 | */ |
||
221 | public function isDebugMode() |
||
225 | |||
226 | /** |
||
227 | * Return's the subject's class name. |
||
228 | * |
||
229 | * @return string The subject's class name |
||
230 | */ |
||
231 | public function getClassName() |
||
235 | |||
236 | /** |
||
237 | * Return's the subject's processor factory type to use. |
||
238 | * |
||
239 | * @return string The subject's processor factory type |
||
240 | */ |
||
241 | public function getProcessorFactory() |
||
245 | |||
246 | /** |
||
247 | * Return's the utility class with the SQL statements to use. |
||
248 | * |
||
249 | * @return string The utility class name |
||
250 | */ |
||
251 | public function getUtilityClassName() |
||
255 | |||
256 | /** |
||
257 | * Return's the array with the params. |
||
258 | * |
||
259 | * @return array The params |
||
260 | */ |
||
261 | public function getParams() |
||
268 | |||
269 | /** |
||
270 | * Query whether or not the param with the passed name exists. |
||
271 | * |
||
272 | * @param string $name The name of the param to be queried |
||
273 | * |
||
274 | * @return boolean TRUE if the requested param exists, else FALSE |
||
275 | */ |
||
276 | public function hasParam($name) |
||
280 | |||
281 | /** |
||
282 | * Return's the param with the passed name. |
||
283 | * |
||
284 | * @param string $name The name of the param to return |
||
285 | * @param mixed $defaultValue The default value if the param doesn't exists |
||
286 | * |
||
287 | * @return string The requested param |
||
288 | * @throws \Exception Is thrown, if the requested param is not available |
||
289 | */ |
||
290 | public function getParam($name, $defaultValue = null) |
||
306 | |||
307 | /** |
||
308 | * Set's the reference to the configuration instance. |
||
309 | * |
||
310 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
311 | * |
||
312 | * @return void |
||
313 | */ |
||
314 | public function setConfiguration(ConfigurationInterface $configuration) |
||
318 | |||
319 | /** |
||
320 | * Return's the reference to the configuration instance. |
||
321 | * |
||
322 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
323 | */ |
||
324 | public function getConfiguration() |
||
328 | |||
329 | /** |
||
330 | * Set's the prefix for the import files. |
||
331 | * |
||
332 | * @param string $prefix The prefix |
||
333 | * |
||
334 | * @return void |
||
335 | */ |
||
336 | public function setPrefix($prefix) |
||
340 | |||
341 | /** |
||
342 | * Return's the prefix for the import files. |
||
343 | * |
||
344 | * @return string The prefix |
||
345 | */ |
||
346 | public function getPrefix() |
||
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 |