src/CoreBundle/EventListener/DcGeneral/Table/MetaModel/LanguageArrayListener.php
public function handleDecode(DecodePropertyValueForWidgetEvent $event)
    {
        if (!$this->wantToHandle($event) || ($event->getProperty() !== 'languages')) {
            return;
        }

        $langValues = (array) $event->getValue();
        $output     = [];
        foreach ($langValues as $langCode => $subValue) {
            if (is_array($subValue)) {
                $output[] = array_merge($subValue, ['langcode' => $langCode]);
            }
        }

        $event->setValue($output);
    }
public function handleDecode(DecodePropertyValueForWidgetEvent $event)
    {
        if (!$this->wantToHandle($event) || ($event->getProperty() !== 'languages')) {
            return;
        }

        $langValues = (array) $event->getValue();
        $output     = [];
        foreach ($langValues as $langCode => $subValue) {
            if (is_array($subValue)) {
                $output[] = array_merge($subValue, ['langcode' => $langCode]);
            }
        }

        $event->setValue($output);
    }
Decode a language array.

@param DecodePropertyValueForWidgetEvent $event The event.

@return void