@@ -61,6 +61,8 @@ public function __construct(
61
61
}
62
62
63
63
/**
64
+ * Add error via code and level
65
+ *
64
66
* @param string $errorCode
65
67
* @param string $errorLevel
66
68
* @param int|null $rowNumber
@@ -96,6 +98,8 @@ public function addError(
96
98
}
97
99
98
100
/**
101
+ * Add row to be skipped during import
102
+ *
99
103
* @param int $rowNumber
100
104
* @return $this
101
105
*/
@@ -110,6 +114,8 @@ public function addRowToSkip($rowNumber)
110
114
}
111
115
112
116
/**
117
+ * Add specific row to invalid list via row number
118
+ *
113
119
* @param int $rowNumber
114
120
* @return $this
115
121
*/
@@ -126,6 +132,8 @@ protected function processInvalidRow($rowNumber)
126
132
}
127
133
128
134
/**
135
+ * Add error message template
136
+ *
129
137
* @param string $code
130
138
* @param string $template
131
139
* @return $this
@@ -138,6 +146,8 @@ public function addErrorMessageTemplate($code, $template)
138
146
}
139
147
140
148
/**
149
+ * Check if row is invalid by row number
150
+ *
141
151
* @param int $rowNumber
142
152
* @return bool
143
153
*/
@@ -147,6 +157,8 @@ public function isRowInvalid($rowNumber)
147
157
}
148
158
149
159
/**
160
+ * Get number of invalid rows
161
+ *
150
162
* @return int
151
163
*/
152
164
public function getInvalidRowsCount ()
@@ -155,6 +167,8 @@ public function getInvalidRowsCount()
155
167
}
156
168
157
169
/**
170
+ * Initialize validation strategy
171
+ *
158
172
* @param string $validationStrategy
159
173
* @param int $allowedErrorCount
160
174
* @return $this
@@ -178,6 +192,8 @@ public function initValidationStrategy($validationStrategy, $allowedErrorCount =
178
192
}
179
193
180
194
/**
195
+ * Check if import has to be terminated
196
+ *
181
197
* @return bool
182
198
*/
183
199
public function hasToBeTerminated ()
@@ -186,6 +202,8 @@ public function hasToBeTerminated()
186
202
}
187
203
188
204
/**
205
+ * Check if error limit has been exceeded
206
+ *
189
207
* @return bool
190
208
*/
191
209
public function isErrorLimitExceeded ()
@@ -203,6 +221,8 @@ public function isErrorLimitExceeded()
203
221
}
204
222
205
223
/**
224
+ * Check if import has a fatal error
225
+ *
206
226
* @return bool
207
227
*/
208
228
public function hasFatalExceptions ()
@@ -211,6 +231,8 @@ public function hasFatalExceptions()
211
231
}
212
232
213
233
/**
234
+ * Get all errors from an import process
235
+ *
214
236
* @return ProcessingError[]
215
237
*/
216
238
public function getAllErrors ()
@@ -228,6 +250,8 @@ public function getAllErrors()
228
250
}
229
251
230
252
/**
253
+ * Get a specific set of errors via codes
254
+ *
231
255
* @param string[] $codes
232
256
* @return ProcessingError[]
233
257
*/
@@ -244,6 +268,8 @@ public function getErrorsByCode(array $codes)
244
268
}
245
269
246
270
/**
271
+ * Get an error via row number
272
+ *
247
273
* @param int $rowNumber
248
274
* @return ProcessingError[]
249
275
*/
@@ -258,6 +284,8 @@ public function getErrorByRowNumber($rowNumber)
258
284
}
259
285
260
286
/**
287
+ * Get a set rows via a set of error codes
288
+ *
261
289
* @param array $errorCode
262
290
* @param array $excludedCodes
263
291
* @param bool $replaceCodeWithMessage
@@ -292,6 +320,8 @@ public function getRowsGroupedByErrorCode(
292
320
}
293
321
294
322
/**
323
+ * Get the max allowed error count
324
+ *
295
325
* @return int
296
326
*/
297
327
public function getAllowedErrorsCount ()
@@ -300,6 +330,8 @@ public function getAllowedErrorsCount()
300
330
}
301
331
302
332
/**
333
+ * Get current error count
334
+ *
303
335
* @param string[] $errorLevels
304
336
* @return int
305
337
*/
@@ -318,6 +350,8 @@ public function getErrorsCount(
318
350
}
319
351
320
352
/**
353
+ * Clear the error aggregator
354
+ *
321
355
* @return $this
322
356
*/
323
357
public function clear ()
@@ -331,6 +365,8 @@ public function clear()
331
365
}
332
366
333
367
/**
368
+ * Check if an error has already been added to the aggregator
369
+ *
334
370
* @param int $rowNum
335
371
* @param string $errorCode
336
372
* @param string $columnName
@@ -348,6 +384,8 @@ protected function isErrorAlreadyAdded($rowNum, $errorCode, $columnName = null)
348
384
}
349
385
350
386
/**
387
+ * Build an error message via code, message and column name
388
+ *
351
389
* @param string $errorCode
352
390
* @param string $errorMessage
353
391
* @param string $columnName
@@ -369,6 +407,8 @@ protected function getErrorMessage($errorCode, $errorMessage, $columnName)
369
407
}
370
408
371
409
/**
410
+ * Process the error statistics for a given error level
411
+ *
372
412
* @param string $errorLevel
373
413
* @return $this
374
414
*/
0 commit comments