src/Sulu/Bundle/PageBundle/EventListener/TeaserSerializeEventSubscriber.php
public function onPostSerialize(ObjectEvent $event)
    {
        $teaser = $event->getObject();
        $visitor = $event->getVisitor();
        $context = $event->getContext();

        if (!($teaser instanceof Teaser)) {
            return;
        }

        $visitor->addData('teaserId', $context->accept(sprintf('%s;%s', $teaser->getType(), $teaser->getId())));
    }
public function onPostSerialize(ObjectEvent $event)
    {
        $teaser = $event->getObject();
        $visitor = $event->getVisitor();
        $context = $event->getContext();

        if (!($teaser instanceof Teaser)) {
            return;
        }

        $visitor->addData('teaserId', $context->accept(sprintf('%s;%s', $teaser->getType(), $teaser->getId())));
    }
public function onPostSerialize ( ObjectEvent $ event ) { $ teaser = $ event -> getObject ( ) ; $ visitor = $ event -> getVisitor ( ) ; $ context = $ event -> getContext ( ) ; if ( ! ( $ teaser instanceof Teaser ) ) { return ; } $ visitor -> addData ( 'teaserId' , $ context -> accept ( sprintf ( '%s;%s' , $ teaser -> getType ( ) , $ teaser -> getId ( ) ) ) ) ; }
Add uniqueid and media-data to serialized data.

@param ObjectEvent $event
Add uniqueid and media - data to serialized data .