public function onPreSerialize(ObjectEvent $event)
    {
        $configuredType = $event->getObject();

        if ($configuredType instanceof ConfiguredType) {
            try {
                $configurationArray = json_decode($configuredType->getConfiguration(), true);
                $extraFormType = $this->registry->getType($configurationArray['form_type']);
                $configuredType->setExtraFormType($extraFormType);
            } catch (\Exception $e) {
                return;
            }
        }
    }
public function onPreSerialize(ObjectEvent $event)
    {
        $configuredType = $event->getObject();

        if ($configuredType instanceof ConfiguredType) {
            try {
                $configurationArray = json_decode($configuredType->getConfiguration(), true);
                $extraFormType = $this->registry->getType($configurationArray['form_type']);
                $configuredType->setExtraFormType($extraFormType);
            } catch (\Exception $e) {
                return;
            }
        }
    }
public function onPreSerialize ( ObjectEvent $ event ) { $ configuredType = $ event -> getObject ( ) ; if ( $ configuredType instanceof ConfiguredType ) { try { $ configurationArray = json_decode ( $ configuredType -> getConfiguration ( ) , true ) ; $ extraFormType = $ this -> registry -> getType ( $ configurationArray [ 'form_type' ] ) ; $ configuredType -> setExtraFormType ( $ extraFormType ) ; } catch ( \ Exception $ e ) { return ; } } }
Method called on pre serialize event.

@param ObjectEvent $event
Method called on pre serialize event .