You are here

protected function SmartDate::prepareValues in Smart Date 3.1.x

Same name and namespace in other branches
  1. 8.2 src/Feeds/Target/SmartDate.php \Drupal\smart_date\Feeds\Target\SmartDate::prepareValues()
  2. 3.x src/Feeds/Target/SmartDate.php \Drupal\smart_date\Feeds\Target\SmartDate::prepareValues()
  3. 3.0.x src/Feeds/Target/SmartDate.php \Drupal\smart_date\Feeds\Target\SmartDate::prepareValues()
  4. 3.2.x src/Feeds/Target/SmartDate.php \Drupal\smart_date\Feeds\Target\SmartDate::prepareValues()
  5. 3.3.x src/Feeds/Target/SmartDate.php \Drupal\smart_date\Feeds\Target\SmartDate::prepareValues()
  6. 3.4.x src/Feeds/Target/SmartDate.php \Drupal\smart_date\Feeds\Target\SmartDate::prepareValues()

File

src/Feeds/Target/SmartDate.php, line 48

Class

SmartDate
Defines a smartdate field mapper.

Namespace

Drupal\smart_date\Feeds\Target

Code

protected function prepareValues(array $values) {
  $return = [];
  foreach ($values as $delta => $columns) {
    try {
      $this
        ->prepareValue($delta, $columns);
      $return[] = $columns;
    } catch (EmptyFeedException $e) {

      // Nothing wrong here.
    } catch (TargetValidationException $e) {

      // Validation failed.
      \Drupal::messenger()
        ->addError($e
        ->getMessage());
    }
  }
  return $return;
}