LanguageTypes.php
Same filename in other branches
Namespace
Drupal\language\Plugin\migrate\processFile
-
core/
modules/ language/ src/ Plugin/ migrate/ process/ LanguageTypes.php
View source
<?php
namespace Drupal\language\Plugin\migrate\process;
use Drupal\migrate\MigrateException;
use Drupal\migrate\MigrateExecutableInterface;
use Drupal\migrate\ProcessPluginBase;
use Drupal\migrate\Row;
/**
* Processes the array for the language types.
*
* @MigrateProcessPlugin(
* id = "language_types",
* handle_multiples = TRUE
* )
*/
class LanguageTypes extends ProcessPluginBase {
/**
* {@inheritdoc}
*/
public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
if (!is_array($value)) {
throw new MigrateException('The input should be an array');
}
if (array_key_exists('language', $value)) {
$value['language_interface'] = $value['language'];
unset($value['language']);
}
if (!empty($this->configuration['filter_configurable'])) {
$value = array_filter($value);
}
return array_keys($value);
}
}
Classes
Title | Deprecated | Summary |
---|---|---|
LanguageTypes | Processes the array for the language types. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.