src/Sulu/Bundle/DocumentManagerBundle/Bridge/Serializer/Subscriber/ChildrenSubscriber.php
public function onPostSerialize(ObjectEvent $event)
    {
        $document = $event->getObject();

        if (!$document instanceof ChildrenBehavior || !$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $visitor = $event->getVisitor();
        $visitor->addData('hasSub', $this->documentInspector->hasChildren($document));
    }
public function onPostSerialize(ObjectEvent $event)
    {
        $document = $event->getObject();

        if (!$document instanceof ChildrenBehavior || !$this->documentRegistry->hasDocument($document)) {
            return;
        }

        $visitor = $event->getVisitor();
        $visitor->addData('hasSub', $this->documentInspector->hasChildren($document));
    }
public function onPostSerialize ( ObjectEvent $ event ) { $ document = $ event -> getObject ( ) ; if ( ! $ document instanceof ChildrenBehavior || ! $ this -> documentRegistry -> hasDocument ( $ document ) ) { return ; } $ visitor = $ event -> getVisitor ( ) ; $ visitor -> addData ( 'hasSub' , $ this -> documentInspector -> hasChildren ( $ document ) ) ; }
Adds a flag to indicate if the document has children.

@param ObjectEvent $event
Adds a flag to indicate if the document has children .