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

Inheritance: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Afficher le fichier Open project: sulu/sulu Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( Sulu\Component\DocumentManager\PropertyEncoder $propertyEncoder, Sulu\Component\DocumentManager\DocumentInspector $documentInspector, PHPCR\SessionInterface $defaultSession, PHPCR\SessionInterface $liveSession )
getSubscribedEvents ( )
setWorkflowStageOnDocument ( Sulu\Component\DocumentManager\Event\HydrateEvent $event ) Sets the workflow properties from the node on the document.
setWorkflowStageToPublished ( Sulu\Component\DocumentManager\Event\PublishEvent $event ) Sets the workflow stage for the passed document to published.
setWorkflowStageToTest ( Sulu\Component\DocumentManager\Event\PersistEvent $event ) Sets the workflow stage for the passed document to test.
setWorkflowStageToTestAndResetPublishedDate ( Sulu\Component\DocumentManager\Event\UnpublishEvent $event ) Resets the workflowstage to test and the published date to null.
setWorkflowStageToTestForCopy ( Sulu\Component\DocumentManager\Event\CopyEvent $event ) Sets the workflowstage for the copied node and all its children to test. This is done because newly copied pages shouldn't be automatically published on the website.

Private Methods

Méthode Description
setNodeWorkflowStageToTestForCopy ( PHPCR\NodeInterface $node ) Sets the workflowstage and the published date for the given node and all of its children to test resp. null. This is done for every language in which the given properties exist.
setWorkflowStage ( Sulu\Component\Content\Document\Behavior\WorkflowStageBehavior $document, Sulu\Component\DocumentManager\DocumentAccessor $accessor, string $workflowStage, string $locale, string $live ) Sets the workflow properties on the given document.
setWorkflowStageOnNode ( PHPCR\NodeInterface $node, string $locale, integer $workflowStage, boolean $updatePublished ) Sets the workflow stage properties on the given node.
supports ( Sulu\Component\DocumentManager\Event\HydrateEvent | Sulu\Component\DocumentManager\Event\PublishEvent | Sulu\Component\DocumentManager\Event\PersistEvent $event ) : boolean Determines if the given document is supported by this subscriber.

Method Details

__construct() public méthode

public __construct ( Sulu\Component\DocumentManager\PropertyEncoder $propertyEncoder, Sulu\Component\DocumentManager\DocumentInspector $documentInspector, PHPCR\SessionInterface $defaultSession, PHPCR\SessionInterface $liveSession )
$propertyEncoder Sulu\Component\DocumentManager\PropertyEncoder
$documentInspector Sulu\Component\DocumentManager\DocumentInspector
$defaultSession PHPCR\SessionInterface
$liveSession PHPCR\SessionInterface

getSubscribedEvents() public static méthode

public static getSubscribedEvents ( )

setWorkflowStageOnDocument() public méthode

Sets the workflow properties from the node on the document.
public setWorkflowStageOnDocument ( Sulu\Component\DocumentManager\Event\HydrateEvent $event )
$event Sulu\Component\DocumentManager\Event\HydrateEvent

setWorkflowStageToPublished() public méthode

Sets the workflow stage for the passed document to published.
public setWorkflowStageToPublished ( Sulu\Component\DocumentManager\Event\PublishEvent $event )
$event Sulu\Component\DocumentManager\Event\PublishEvent

setWorkflowStageToTest() public méthode

Sets the workflow stage for the passed document to test.
public setWorkflowStageToTest ( Sulu\Component\DocumentManager\Event\PersistEvent $event )
$event Sulu\Component\DocumentManager\Event\PersistEvent

setWorkflowStageToTestAndResetPublishedDate() public méthode

Resets the workflowstage to test and the published date to null.
public setWorkflowStageToTestAndResetPublishedDate ( Sulu\Component\DocumentManager\Event\UnpublishEvent $event )
$event Sulu\Component\DocumentManager\Event\UnpublishEvent

setWorkflowStageToTestForCopy() public méthode

Sets the workflowstage for the copied node and all its children to test. This is done because newly copied pages shouldn't be automatically published on the website.
public setWorkflowStageToTestForCopy ( Sulu\Component\DocumentManager\Event\CopyEvent $event )
$event Sulu\Component\DocumentManager\Event\CopyEvent