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

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Mostra file Open project: sulu/sulu

Public Methods

Method Description
__construct ( Sulu\Component\DocumentManager\DocumentManagerInterface $documentManager, DocumentInspector $documentInspector, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager )
getSubscribedEvents ( )
handleHydrate ( Sulu\Component\DocumentManager\Event\HydrateEvent $event ) Writes the history status of the node to the document.
handlePersist ( Sulu\Component\DocumentManager\Event\PersistEvent $event ) Updates the route for the given document and creates history routes if necessary.
handlePublish ( Sulu\Component\DocumentManager\Event\PublishEvent $event ) Handles the history field for the route on publish.
handleRemove ( Sulu\Component\DocumentManager\Event\RemoveEvent $event ) Removes the routes for the given document and removes history routes if necessary.

Private Methods

Method Description
changeOldPathToHistoryRoutes ( Sulu\Component\Content\Document\Behavior\RouteBehavior $oldDocument, Sulu\Component\Content\Document\Behavior\RouteBehavior $newDocument ) Changes the old route to a history route and redirect to the new route.
recursivelyRemoveRoutes ( Sulu\Component\Content\Document\Behavior\RouteBehavior $document ) Remove given Route and his history.

Method Details

__construct() public method

public __construct ( Sulu\Component\DocumentManager\DocumentManagerInterface $documentManager, DocumentInspector $documentInspector, Sulu\Component\PHPCR\SessionManager\SessionManagerInterface $sessionManager )
$documentManager Sulu\Component\DocumentManager\DocumentManagerInterface
$documentInspector Sulu\Bundle\DocumentManagerBundle\Bridge\DocumentInspector
$sessionManager Sulu\Component\PHPCR\SessionManager\SessionManagerInterface

getSubscribedEvents() public static method

public static getSubscribedEvents ( )

handleHydrate() public method

Writes the history status of the node to the document.
public handleHydrate ( Sulu\Component\DocumentManager\Event\HydrateEvent $event )
$event Sulu\Component\DocumentManager\Event\HydrateEvent

handlePersist() public method

Updates the route for the given document and creates history routes if necessary.
public handlePersist ( Sulu\Component\DocumentManager\Event\PersistEvent $event )
$event Sulu\Component\DocumentManager\Event\PersistEvent

handlePublish() public method

Handles the history field for the route on publish.
public handlePublish ( Sulu\Component\DocumentManager\Event\PublishEvent $event )
$event Sulu\Component\DocumentManager\Event\PublishEvent

handleRemove() public method

Removes the routes for the given document and removes history routes if necessary.
public handleRemove ( Sulu\Component\DocumentManager\Event\RemoveEvent $event )
$event Sulu\Component\DocumentManager\Event\RemoveEvent