Language.php in Feeds 8.3
File
src/Feeds/Target/Language.php
View source
<?php
namespace Drupal\feeds\Feeds\Target;
use Drupal\feeds\Plugin\Type\Target\FieldTargetBase;
use Drupal\feeds\FeedInterface;
use Drupal\Core\Entity\EntityInterface;
class Language extends FieldTargetBase {
public function setTarget(FeedInterface $feed, EntityInterface $entity, $field_name, array $values) {
if ($values = $this
->prepareValues($values)) {
$langcode = isset($values[0]['value']) ? $values[0]['value'] : NULL;
if (!empty($langcode)) {
$entity
->set($field_name, $langcode);
}
}
}
}