src/Sulu/Component/Content/Document/Subscriber/ResourceSegmentSubscriber.php
public function handlePersistDocument(PersistEvent $event)
    {
        /** @var ResourceSegmentBehavior $document */
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        $property = $this->getResourceSegmentProperty($document);
        // check if a property for the resource segment is available, this prevents the code from failing in case there
        // is no such property for some reason (e.g. the document doesn't have a structure)
        if ($property) {
            $this->persistDocument($document, $property);
        }
    }
public function handlePersistDocument(PersistEvent $event)
    {
        /** @var ResourceSegmentBehavior $document */
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        $property = $this->getResourceSegmentProperty($document);
        // check if a property for the resource segment is available, this prevents the code from failing in case there
        // is no such property for some reason (e.g. the document doesn't have a structure)
        if ($property) {
            $this->persistDocument($document, $property);
        }
    }
public function handlePersistDocument ( PersistEvent $ event ) { /** @var ResourceSegmentBehavior $document */ $ document = $ event -> getDocument ( ) ; if ( ! $ this -> supports ( $ document ) ) { return ; } $ property = $ this -> getResourceSegmentProperty ( $ document ) ; // check if a property for the resource segment is available, this prevents the code from failing in case there // is no such property for some reason (e.g. the document doesn't have a structure) if ( $ property ) { $ this -> persistDocument ( $ document , $ property ) ; } }
Sets the ResourceSegment on the Structure.

@param PersistEvent $event
Sets the ResourceSegment on the Structure .