public function onPostSerialize(ObjectEvent $event)
    {
        if ($this->container->has('routing')) {
            $uri = $this->container->get('routing')->getUri($event->getObject()->getUrl());
            $event->getVisitor()->addData('uri', $uri);
        }
    }
public function onPostSerialize(ObjectEvent $event)
    {
        if ($this->container->has('routing')) {
            $uri = $this->container->get('routing')->getUri($event->getObject()->getUrl());
            $event->getVisitor()->addData('uri', $uri);
        }
    }
public function onPostSerialize ( ObjectEvent $ event ) { if ( $ this -> container -> has ( 'routing' ) ) { $ uri = $ this -> container -> get ( 'routing' ) -> getUri ( $ event -> getObject ( ) -> getUrl ( ) ) ; $ event -> getVisitor ( ) -> addData ( 'uri' , $ uri ) ; } }
Method called on serializer.post_serialize event for Page object.

@param \JMS\Serializer\EventDispatcher\ObjectEvent $event
Method called on serializer . post_serialize event for Page object .