PHP Класс Sulu\Bundle\ContentBundle\Document\Subscriber\PublishSubscriber

Наследование: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( PHPCR\SessionInterface $liveSession, Sulu\Component\DocumentManager\NodeHelperInterface $nodeHelper, PropertyEncoder $propertyEncoder )
copyNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\CopyEvent $event ) If a node is copied a node with the same UUID will be created in the live session.
copyPropertiesFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\RemoveDraftEvent $event )
createNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\PersistEvent $event ) Creates the node with the same UUID in the public workspace if it does not exist yet. In case it does it will be renamed if necessary.
flushPublicWorkspace ( ) Flushes the live session.
getSubscribedEvents ( )
moveNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\MoveEvent $event ) Since moving is not draftable the node will also be moved in the live session immediately.
removeNodeFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\RemoveEvent $event ) Since deleting is not draftable the node will be deleted in the live session as soon as it is deleted in the default session.
removePropertiesFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\UnpublishEvent $event ) Removes all the properties for the given locale from the node, so that the content is not accessible anymore from the live workspace.
reorderNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\ReorderEvent $event ) Reordering is also not draftable, and therefore also immediately applied to the live session.
setNodeFromPublicWorkspaceForPublishing ( Sulu\Component\DocumentManager\Event\PublishEvent $event ) Sets the correct node from the live session for the PublishEvent.
setNodeFromPublicWorkspaceForUnpublishing ( Sulu\Component\DocumentManager\Event\UnpublishEvent $event ) Sets the correct node from the live session for the UnpublishEvent.

Приватные методы

Метод Описание
copyNodeWithChildrenInPublicWorkspace ( PHPCR\NodeInterface $node )
createNodesWithUuid ( PHPCR\NodeInterface $node ) Creates every node on the path to the given node. Also uses the same UUIDs for these nodes.
getLiveNode ( Sulu\Component\DocumentManager\Behavior\Mapping\PathBehavior $document ) : PHPCR\NodeInterface Returns the live node for given document.
removeLocalizedNodeProperties ( PHPCR\NodeInterface $node, string $locale ) Removes all localized properties in the given locale from the given node.
setNodeFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\PublishEvent | Sulu\Component\DocumentManager\Event\UnpublishEvent $event ) Sets the node from the live workspace on the given event.

Описание методов

__construct() публичный Метод

public __construct ( PHPCR\SessionInterface $liveSession, Sulu\Component\DocumentManager\NodeHelperInterface $nodeHelper, PropertyEncoder $propertyEncoder )
$liveSession PHPCR\SessionInterface
$nodeHelper Sulu\Component\DocumentManager\NodeHelperInterface
$propertyEncoder Sulu\Bundle\DocumentManagerBundle\Bridge\PropertyEncoder

copyNodeInPublicWorkspace() публичный Метод

If a node is copied a node with the same UUID will be created in the live session.
public copyNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\CopyEvent $event )
$event Sulu\Component\DocumentManager\Event\CopyEvent

copyPropertiesFromPublicWorkspace() публичный Метод

public copyPropertiesFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\RemoveDraftEvent $event )
$event Sulu\Component\DocumentManager\Event\RemoveDraftEvent

createNodeInPublicWorkspace() публичный Метод

Creates the node with the same UUID in the public workspace if it does not exist yet. In case it does it will be renamed if necessary.
public createNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\PersistEvent $event )
$event Sulu\Component\DocumentManager\Event\PersistEvent

flushPublicWorkspace() публичный Метод

Flushes the live session.

getSubscribedEvents() публичный статический Метод

public static getSubscribedEvents ( )

moveNodeInPublicWorkspace() публичный Метод

Since moving is not draftable the node will also be moved in the live session immediately.
public moveNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\MoveEvent $event )
$event Sulu\Component\DocumentManager\Event\MoveEvent

removeNodeFromPublicWorkspace() публичный Метод

Since deleting is not draftable the node will be deleted in the live session as soon as it is deleted in the default session.
public removeNodeFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\RemoveEvent $event )
$event Sulu\Component\DocumentManager\Event\RemoveEvent

removePropertiesFromPublicWorkspace() публичный Метод

Removes all the properties for the given locale from the node, so that the content is not accessible anymore from the live workspace.
public removePropertiesFromPublicWorkspace ( Sulu\Component\DocumentManager\Event\UnpublishEvent $event )
$event Sulu\Component\DocumentManager\Event\UnpublishEvent

reorderNodeInPublicWorkspace() публичный Метод

Reordering is also not draftable, and therefore also immediately applied to the live session.
public reorderNodeInPublicWorkspace ( Sulu\Component\DocumentManager\Event\ReorderEvent $event )
$event Sulu\Component\DocumentManager\Event\ReorderEvent

setNodeFromPublicWorkspaceForPublishing() публичный Метод

Sets the correct node from the live session for the PublishEvent.
public setNodeFromPublicWorkspaceForPublishing ( Sulu\Component\DocumentManager\Event\PublishEvent $event )
$event Sulu\Component\DocumentManager\Event\PublishEvent

setNodeFromPublicWorkspaceForUnpublishing() публичный Метод

Sets the correct node from the live session for the UnpublishEvent.
public setNodeFromPublicWorkspaceForUnpublishing ( Sulu\Component\DocumentManager\Event\UnpublishEvent $event )
$event Sulu\Component\DocumentManager\Event\UnpublishEvent