You are here

protected function FeedsProcessor::unravelFieldValidationExceptionErrors in Feeds 7.2

Helper function to unravel error messages hidden in a FieldValidationException.

Parameters

array $field_item_errors: The errors for a single field item.

Return value

array The unraveled error messages.

1 call to FeedsProcessor::unravelFieldValidationExceptionErrors()
FeedsProcessor::entityValidate in plugins/FeedsProcessor.inc
Validates an entity.

File

plugins/FeedsProcessor.inc, line 288
Contains FeedsProcessor and related classes.

Class

FeedsProcessor
Abstract class, defines interface for processors.

Code

protected function unravelFieldValidationExceptionErrors(array $field_item_errors) {
  $errors = array();
  foreach ($field_item_errors as $field_item_error) {
    if (isset($field_item_error['message'])) {

      // Found the error message!
      $errors[] = $field_item_error['message'];
    }
    elseif (is_array($field_item_error)) {

      // Error message is hidden deeper in the tree.
      $errors = array_merge($errors, $this
        ->unravelFieldValidationExceptionErrors($field_item_error));
    }
  }
  return $errors;
}