1 | <?php |
||
37 | class Subject implements SubjectConfigurationInterface |
||
38 | { |
||
39 | |||
40 | /** |
||
41 | * The trait that provides parameter handling functionality. |
||
42 | * |
||
43 | * @var \TechDivision\Import\Configuration\Jms\Configuration\ParamsTrait |
||
44 | */ |
||
45 | use ParamsTrait; |
||
46 | |||
47 | /** |
||
48 | * The subject's unique DI identifier. |
||
49 | * |
||
50 | * @var string |
||
51 | * @Type("string") |
||
52 | * @SerializedName("id") |
||
53 | */ |
||
54 | protected $id; |
||
55 | |||
56 | /** |
||
57 | * The file prefix for import files. |
||
58 | * |
||
59 | * @var string |
||
60 | * @Type("string") |
||
61 | */ |
||
62 | protected $prefix = 'magento-import'; |
||
63 | |||
64 | /** |
||
65 | * The array with the subject's observers. |
||
66 | * |
||
67 | * @var array |
||
68 | * @Type("array") |
||
69 | */ |
||
70 | protected $observers = array(); |
||
71 | |||
72 | /** |
||
73 | * The array with the subject's callbacks. |
||
74 | * |
||
75 | * @var array |
||
76 | * @Type("array<string, array>") |
||
77 | */ |
||
78 | protected $callbacks = array(); |
||
79 | |||
80 | /** |
||
81 | * A reference to the parent configuration instance. |
||
82 | * |
||
83 | * @var \TechDivision\Import\ConfigurationInterface |
||
84 | */ |
||
85 | protected $configuration; |
||
86 | |||
87 | /** |
||
88 | * The flag to signal that the subjects needs a OK file to be processed or not. |
||
89 | * |
||
90 | * @var boolean |
||
91 | * @Type("boolean") |
||
92 | * @SerializedName("ok-file-needed") |
||
93 | */ |
||
94 | protected $okFileNeeded = false; |
||
95 | |||
96 | /** |
||
97 | * Return's the multiple field delimiter character to use, default value is comma (,). |
||
98 | * |
||
99 | * @return string The multiple field delimiter character |
||
100 | */ |
||
101 | public function getMultipleFieldDelimiter() |
||
105 | |||
106 | /** |
||
107 | * Return's the multiple value delimiter character to use, default value is comma (|). |
||
108 | * |
||
109 | * @return string The multiple value delimiter character |
||
110 | */ |
||
111 | public function getMultipleValueDelimiter() |
||
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 unique DI identifier. |
||
228 | * |
||
229 | * @return string The subject's unique DI identifier |
||
230 | */ |
||
231 | public function getId() |
||
235 | |||
236 | /** |
||
237 | * Set's the reference to the configuration instance. |
||
238 | * |
||
239 | * @param \TechDivision\Import\ConfigurationInterface $configuration The configuration instance |
||
240 | * |
||
241 | * @return void |
||
242 | */ |
||
243 | public function setConfiguration(ConfigurationInterface $configuration) |
||
247 | |||
248 | /** |
||
249 | * Return's the reference to the configuration instance. |
||
250 | * |
||
251 | * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
||
252 | */ |
||
253 | public function getConfiguration() |
||
257 | |||
258 | /** |
||
259 | * Set's the prefix for the import files. |
||
260 | * |
||
261 | * @param string $prefix The prefix |
||
262 | * |
||
263 | * @return void |
||
264 | */ |
||
265 | public function setPrefix($prefix) |
||
269 | |||
270 | /** |
||
271 | * Return's the prefix for the import files. |
||
272 | * |
||
273 | * @return string The prefix |
||
274 | */ |
||
275 | public function getPrefix() |
||
279 | |||
280 | /** |
||
281 | * Return's the array with the subject's observers. |
||
282 | * |
||
283 | * @return array The subject's observers |
||
284 | */ |
||
285 | public function getObservers() |
||
289 | |||
290 | /** |
||
291 | * Return's the array with the subject's callbacks. |
||
292 | * |
||
293 | * @return array The subject's callbacks |
||
294 | */ |
||
295 | public function getCallbacks() |
||
299 | |||
300 | /** |
||
301 | * Set's the flag to signal that the an OK file is needed for the subject |
||
302 | * to be processed. |
||
303 | * |
||
304 | * @param boolean $okFileNeeded TRUE if the subject needs an OK file, else FALSE |
||
305 | * |
||
306 | * @return void |
||
307 | */ |
||
308 | public function setOkFileNeeded($okFileNeeded) |
||
312 | |||
313 | /** |
||
314 | * Queries whether or not that the subject needs an OK file to be processed. |
||
315 | * |
||
316 | * @return boolean TRUE if the subject needs an OK file, else FALSE |
||
317 | */ |
||
318 | public function isOkFileNeeded() |
||
322 | } |
||
323 |