public function ConfigurableLanguageHandler::onCreateCdf in Acquia Content Hub 8.2
Adds the langcode metadata to configurable_language cdf objects.
Parameters
\Drupal\acquia_contenthub\Event\CreateCdfEntityEvent $event: The parse cdf entity event object.
File
- src/
EventSubscriber/ Cdf/ ConfigurableLanguageHandler.php, line 30
Class
- ConfigurableLanguageHandler
- Handler for configurable languages.
Namespace
Drupal\acquia_contenthub\EventSubscriber\CdfCode
public function onCreateCdf(CreateCdfEntityEvent $event) {
$entity = $event
->getEntity();
if ($entity
->getEntityTypeId() !== 'configurable_language') {
return;
}
$cdf = $event
->getCdf($entity
->uuid());
$metadata = $cdf
->getMetadata();
$metadata['langcode'] = $entity
->id();
$cdf
->setMetadata($metadata);
}