1 | <?php |
||
37 | class Subject implements SubjectConfigurationInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The trait that provides parameter handling functionality. |
||
42 | * |
||
43 | * @var \TechDivision\Import\Cli\Configuration\ParamsTrait |
||
44 | */ |
||
45 | use ParamsTrait; |
||
46 | |||
47 | /** |
||
48 | * The subject's class name. |
||
49 | * |
||
50 | * @var string |
||
51 | * @Type("string") |
||
52 | * @SerializedName("class-name") |
||
53 | */ |
||
54 | protected $className; |
||
55 | |||
56 | /** |
||
57 | * The subject's processor type to use. |
||
58 | * |
||
59 | * @var string |
||
60 | * @Type("string") |
||
61 | * @SerializedName("processor-factory") |
||
62 | */ |
||
63 | protected $processorFactory; |
||
64 | |||
65 | /** |
||
66 | * The subject's utility class with the SQL statements to use. |
||
67 | * |
||
68 | * @var string |
||
69 | * @Type("string") |
||
70 | * @SerializedName("utility-class-name") |
||
71 | */ |
||
72 | protected $utilityClassName; |
||
73 | |||
74 | /** |
||
75 | * The file prefix for import files. |
||
76 | * |
||
77 | * @var string |
||
78 | * @Type("string") |
||
79 | */ |
||
80 | protected $prefix = 'magento-import'; |
||
81 | |||
82 | /** |
||
83 | * The array with the subject's observers. |
||
84 | * |
||
85 | * @var array |
||
86 | * @Type("array") |
||
87 | */ |
||
88 | protected $observers = array(); |
||
89 | |||
90 | /** |
||
91 | * The array with the subject's callbacks. |
||
92 | * |
||
93 | * @var array |
||
94 | * @Type("array<string, array>") |
||
95 | */ |
||
96 | protected $callbacks = array(); |
||
97 | |||
98 | /** |
||
99 | * A reference to the parent configuration instance. |
||
100 | * |
||
101 | * @var \TechDivision\Import\ConfigurationInterface |
||
102 | */ |
||
103 | protected $configuration; |
||
104 | |||
105 | /** |
||
106 | * The flag to signal that the subjects needs a OK file to be processed or not. |
||
107 | * |
||
108 | * @var boolean |
||
109 | * @Type("boolean") |
||
110 | * @SerializedName("ok-file-needed") |
||
111 | */ |
||
112 | protected $okFileNeeded = false; |
||
113 | |||
114 | /** |
||
115 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
116 | * |
||
117 | * @return string The multiple field delimiter character |
||
118 | */ |
||
119 | public function getMultipleFieldDelimiter() |
||
123 | |||
124 | /** |
||
125 | * Return's the delimiter character to use, default value is comma (,). |
||
126 | * |
||
127 | * @return string The delimiter character |
||
128 | */ |
||
129 | public function getDelimiter() |
||
133 | |||
134 | /** |
||
135 | * The enclosure character to use, default value is double quotation ("). |
||
136 | * |
||
137 | * @return string The enclosure character |
||
138 | */ |
||
139 | public function getEnclosure() |
||
143 | |||
144 | /** |
||
145 | * The escape character to use, default value is backslash (\). |
||
146 | * |
||
147 | * @return string The escape character |
||
148 | */ |
||
149 | public function getEscape() |
||
153 | |||
154 | /** |
||
155 | * The file encoding of the CSV source file, default value is UTF-8. |
||
156 | * |
||
157 | * @return string The charset used by the CSV source file |
||
158 | */ |
||
159 | public function getFromCharset() |
||
163 | |||
164 | /** |
||
165 | * The file encoding of the CSV targetfile, default value is UTF-8. |
||
166 | * |
||
167 | * @return string The charset used by the CSV target file |
||
168 | */ |
||
169 | public function getToCharset() |
||
173 | |||
174 | /** |
||
175 | * The file mode of the CSV target file, either one of write or append, default is write. |
||
176 | * |
||
177 | * @return string The file mode of the CSV target file |
||
178 | */ |
||
179 | public function getFileMode() |
||
183 | |||
184 | /** |
||
185 | * Queries whether or not strict mode is enabled or not, default is TRUE. |
||
186 | * |
||
187 | * @return boolean TRUE if strict mode is enabled, else FALSE |
||
188 | */ |
||
189 | public function isStrictMode() |
||
193 | |||
194 | /** |
||
195 | * Return's the subject's source date format to use. |
||
196 | * |
||
197 | * @return string The source date format |
||
198 | */ |
||
199 | public function getSourceDateFormat() |
||
203 | |||
204 | /** |
||
205 | * Return's the source directory that has to be watched for new files. |
||
206 | * |
||
207 | * @return string The source directory |
||
208 | */ |
||
209 | public function getSourceDir() |
||
213 | |||
214 | /** |
||
215 | * Return's the target directory with the files that has been imported. |
||
216 | * |
||
217 | * @return string The target directory |
||
218 | */ |
||
219 | public function getTargetDir() |
||
223 | |||
224 | /** |
||
225 | * Queries whether or not debug mode is enabled or not, default is TRUE. |
||
226 | * |
||
227 | * @return boolean TRUE if debug mode is enabled, else FALSE |
||
228 | */ |
||
229 | public function isDebugMode() |
||
233 | |||
234 | /** |
||
235 | * Return's the subject's class name. |
||
236 | * |
||
237 | * @return string The subject's class name |
||
238 | */ |
||
239 | public function getClassName() |
||
243 | |||
244 | /** |
||
245 | * Return's the subject's processor factory type to use. |
||
246 | * |
||
247 | * @return string The subject's processor factory type |
||
248 | */ |
||
249 | public function getProcessorFactory() |
||
253 | |||
254 | /** |
||
255 | * Return's the utility class with the SQL statements to use. |
||
256 | * |
||
257 | * @return string The utility class name |
||
258 | */ |
||
259 | public function getUtilityClassName() |
||
263 | |||
264 | /** |
||
265 | * Set's the reference to the configuration instance. |
||
266 | * |
||
267 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
268 | * |
||
269 | * @return void |
||
270 | */ |
||
271 | public function setConfiguration(ConfigurationInterface $configuration) |
||
275 | |||
276 | /** |
||
277 | * Return's the reference to the configuration instance. |
||
278 | * |
||
279 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
280 | */ |
||
281 | public function getConfiguration() |
||
285 | |||
286 | /** |
||
287 | * Set's the prefix for the import files. |
||
288 | * |
||
289 | * @param string $prefix The prefix |
||
290 | * |
||
291 | * @return void |
||
292 | */ |
||
293 | public function setPrefix($prefix) |
||
297 | |||
298 | /** |
||
299 | * Return's the prefix for the import files. |
||
300 | * |
||
301 | * @return string The prefix |
||
302 | */ |
||
303 | public function getPrefix() |
||
307 | |||
308 | /** |
||
309 | * Return's the array with the subject's observers. |
||
310 | * |
||
311 | * @return array The subject's observers |
||
312 | */ |
||
313 | public function getObservers() |
||
317 | |||
318 | /** |
||
319 | * Return's the array with the subject's callbacks. |
||
320 | * |
||
321 | * @return array The subject's callbacks |
||
322 | */ |
||
323 | public function getCallbacks() |
||
327 | |||
328 | /** |
||
329 | * Set's the flag to signal that the an OK file is needed for the subject |
||
330 | * to be processed. |
||
331 | * |
||
332 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
333 | * |
||
334 | * @return void |
||
335 | */ |
||
336 | public function setOkFileNeeded($okFileNeeded) |
||
340 | |||
341 | /** |
||
342 | * Queries whether or not that the subject needs an OK file to be processed. |
||
343 | * |
||
344 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
345 | */ |
||
346 | public function isOkFileNeeded() |
||
350 | } |
||
351 |