PHP Class Sulu\Component\Content\Document\Subscriber\ResourceSegmentSubscriber

Inheritance: extends Sulu\Component\Content\Document\Subscriber\AbstractMappingSubscriber
ファイルを表示 Open project: sulu/sulu Class Usage Examples

Public Methods

Method Description
__construct ( Sulu\Component\DocumentManager\PropertyEncoder $encoder, Sulu\Component\DocumentManager\DocumentManagerInterface $documentManager, DocumentInspector $documentInspector, Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface $resourceLocatorStrategyPool, PHPCR\SessionInterface $defaultSession, PHPCR\SessionInterface $liveSession )
getSubscribedEvents ( )
handleHydrate ( Sulu\Component\DocumentManager\Event\AbstractMappingEvent $event ) Sets the ResourceSegment of the document.
handlePersistDocument ( Sulu\Component\DocumentManager\Event\PersistEvent $event ) Sets the ResourceSegment on the Structure.
handlePersistRoute ( Sulu\Component\DocumentManager\Event\PublishEvent $event ) Creates or updates the route for the document.
supports ( object $document ) : boolean Checks if the given Document supports the operations done in this Subscriber.
updateCopiedDocument ( Sulu\Component\DocumentManager\Event\CopyEvent $event ) Copy the routes for all localization of the document in the event.
updateMovedDocument ( Sulu\Component\DocumentManager\Event\MoveEvent $event ) Moves the routes for all localizations of the document in the event.

Private Methods

Method Description
getResourceSegmentProperty ( $document ) : PropertyMetadata Returns the property of the document's structure containing the ResourceSegment.
persistDocument ( Sulu\Component\Content\Document\Behavior\ResourceSegmentBehavior $document, PropertyMetadata $property ) Sets the ResourceSegment to the given property of the given document.
persistRoute ( Sulu\Component\Content\Document\Behavior\ResourceSegmentBehavior $document ) Creates or updates the route of the document using the RlpStrategy.
updateResourceSegmentProperty ( PHPCR\NodeInterface $node, string $resourceSegmentPropertyName, string $parentUuid, string $webspaceKey, string $locale ) Updates the property for the resource segment on the given node.
updateRoute ( object $document, boolean $generateRoutes ) Updates the route for the given document after a move or copy.

Method Details

__construct() public method

public __construct ( Sulu\Component\DocumentManager\PropertyEncoder $encoder, Sulu\Component\DocumentManager\DocumentManagerInterface $documentManager, DocumentInspector $documentInspector, Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface $resourceLocatorStrategyPool, PHPCR\SessionInterface $defaultSession, PHPCR\SessionInterface $liveSession )
$encoder Sulu\Component\DocumentManager\PropertyEncoder
$documentManager Sulu\Component\DocumentManager\DocumentManagerInterface
$documentInspector Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector
$resourceLocatorStrategyPool Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface
$defaultSession PHPCR\SessionInterface
$liveSession PHPCR\SessionInterface

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

handleHydrate() public method

Sets the ResourceSegment of the document.
public handleHydrate ( Sulu\Component\DocumentManager\Event\AbstractMappingEvent $event )
$event Sulu\Component\DocumentManager\Event\AbstractMappingEvent

handlePersistDocument() public method

Sets the ResourceSegment on the Structure.
public handlePersistDocument ( Sulu\Component\DocumentManager\Event\PersistEvent $event )
$event Sulu\Component\DocumentManager\Event\PersistEvent

handlePersistRoute() public method

Creates or updates the route for the document.
public handlePersistRoute ( Sulu\Component\DocumentManager\Event\PublishEvent $event )
$event Sulu\Component\DocumentManager\Event\PublishEvent

supports() public method

Checks if the given Document supports the operations done in this Subscriber.
public supports ( object $document ) : boolean
$document object
return boolean

updateCopiedDocument() public method

Copy the routes for all localization of the document in the event.
public updateCopiedDocument ( Sulu\Component\DocumentManager\Event\CopyEvent $event )
$event Sulu\Component\DocumentManager\Event\CopyEvent

updateMovedDocument() public method

Moves the routes for all localizations of the document in the event.
public updateMovedDocument ( Sulu\Component\DocumentManager\Event\MoveEvent $event )
$event Sulu\Component\DocumentManager\Event\MoveEvent