src/Graviton/DocumentBundle/Serializer/Listener/EmptyExtRefListener.php
public function onPreSerialize(PreSerializeEvent $event)
    {
        $object = $event->getObject();
        if ($object instanceof ExtRefHoldingDocumentInterface && $object->isEmptyExtRefObject() === true) {
            $event->setType('Empty', [$object]);
        }
    }
public function onPreSerialize(PreSerializeEvent $event)
    {
        $object = $event->getObject();
        if ($object instanceof ExtRefHoldingDocumentInterface && $object->isEmptyExtRefObject() === true) {
            $event->setType('Empty', [$object]);
        }
    }
public function onPreSerialize ( PreSerializeEvent $ event ) { $ object = $ event -> getObject ( ) ; if ( $ object instanceof ExtRefHoldingDocumentInterface && $ object -> isEmptyExtRefObject ( ) === true ) { $ event -> setType ( 'Empty' , [ $ object ] ) ; } }
if is empty extref object, divert serializing to type Empty, which creates a null instead of empty object

@param PreSerializeEvent $event event

@return void
@throws \Exception
if is empty extref object divert serializing to type Empty which creates a null instead of empty object