protected function Geolocation::prepareValues in Geolocation Field 8.2
Same name and namespace in other branches
- 8.3 src/Feeds/Target/Geolocation.php \Drupal\geolocation\Feeds\Target\Geolocation::prepareValues()
Prepares the the values that will be mapped to an entity.
Parameters
array $values: The values.
Overrides FieldTargetBase::prepareValues
File
- src/
Feeds/ Target/ Geolocation.php, line 52
Class
- Geolocation
- Defines a geolocation field mapper.
Namespace
Drupal\geolocation\Feeds\TargetCode
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;
}