You are here

protected function SmartDate::prepareValue in Smart Date 8.2

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

Prepares a single value.

Parameters

int $delta: The field delta.

array $values: The values.

Overrides FieldTargetBase::prepareValue

1 call to SmartDate::prepareValue()
SmartDate::prepareValues in src/Feeds/Target/SmartDate.php
Prepares the the values that will be mapped to an entity.

File

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

Class

SmartDate
Defines a smartdate field mapper.

Namespace

Drupal\smart_date\Feeds\Target

Code

protected function prepareValue($delta, array &$values) {
  if (isset($values)) {
    if (isset($values['value']) && !isset($values['end_value'])) {
      $values['end_value'] = $values['value'];
    }
    return $values;
  }
  else {
    throw new EmptyFeedException();
  }
}