class LanguageTypes in Drupal 10
Same name and namespace in other branches
- 8 core/modules/language/src/Plugin/migrate/process/LanguageTypes.php \Drupal\language\Plugin\migrate\process\LanguageTypes
- 9 core/modules/language/src/Plugin/migrate/process/LanguageTypes.php \Drupal\language\Plugin\migrate\process\LanguageTypes
Processes the array for the language types.
Plugin annotation
@MigrateProcessPlugin(
id = "language_types",
handle_multiples = TRUE
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\migrate\ProcessPluginBase implements MigrateProcessInterface
- class \Drupal\language\Plugin\migrate\process\LanguageTypes
- class \Drupal\migrate\ProcessPluginBase implements MigrateProcessInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of LanguageTypes
1 file declares its use of LanguageTypes
- LanguageTypesTest.php in core/
modules/ language/ tests/ src/ Unit/ process/ LanguageTypesTest.php
File
- core/
modules/ language/ src/ Plugin/ migrate/ process/ LanguageTypes.php, line 18
Namespace
Drupal\language\Plugin\migrate\processView source
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);
}
}