PHP Class Neos\ContentRepository\Domain\Service\PublishingService

Inheritance: implements Neos\ContentRepository\Domain\Service\PublishingServiceInterface
Datei anzeigen Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$contentDimensionPresetSource Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeFactory Neos\ContentRepository\Domain\Factory\NodeFactory
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

Public Methods

Method Description
discardAllNodes ( Workspace $workspace ) : void Discards all unpublished nodes of the given workspace.
discardNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void Discards the given node.
discardNodes ( array $nodes ) : void Discards the given nodes.
emitNodeDiscarded ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void Signals that a node has been discarded.
emitNodePublished ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace = null ) : void Signals that a node has been published.
getUnpublishedNodes ( Workspace $workspace ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface> Returns a list of nodes contained in the given workspace which are not yet published
getUnpublishedNodesCount ( Workspace $workspace ) : integer Returns the number of unpublished nodes contained in the given workspace
publishNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace = null ) : void Publishes the given node to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
publishNodes ( array $nodes, Workspace $targetWorkspace = null ) : void Publishes the given nodes to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.

Protected Methods

Method Description
createContext ( Workspace $workspace, array $dimensionValues, array $contextProperties = [] ) : Context Creates a new content context based on the given workspace and the NodeData object.
doDiscardNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, array &$alreadyDiscardedNodeIdentifiers = [] ) : void Method which does the actual work of discarding, includes a protection against endless recursions and multiple discarding of the same node.
sortNodesForPublishing ( array $nodes ) : array Sort an unsorted list of nodes in a publishable order

Method Details

createContext() protected method

Creates a new content context based on the given workspace and the NodeData object.
protected createContext ( Workspace $workspace, array $dimensionValues, array $contextProperties = [] ) : Context
$workspace Neos\ContentRepository\Domain\Model\Workspace Workspace for the new context
$dimensionValues array The dimension values for the new context
$contextProperties array Additional pre-defined context properties
return Context

discardAllNodes() public method

TODO: This method needs to be optimized / implemented in collaboration with a DQL-based method in NodeDataRepository
public discardAllNodes ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace The workspace to flush, can't be the live workspace
return void

discardNode() public method

If the node has been moved, this method will also discard all changes of child nodes of the given node.
public discardNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node to discard
return void

discardNodes() public method

Discards the given nodes.
public discardNodes ( array $nodes ) : void
$nodes array
return void

doDiscardNode() protected method

Method which does the actual work of discarding, includes a protection against endless recursions and multiple discarding of the same node.
protected doDiscardNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, array &$alreadyDiscardedNodeIdentifiers = [] ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node to discard
$alreadyDiscardedNodeIdentifiers array
return void

emitNodeDiscarded() public method

The signal emits the node that has been discarded.
public emitNodeDiscarded ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
return void

emitNodePublished() public method

The signal emits the source node and target workspace, i.e. the node contains its source workspace.
public emitNodePublished ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace = null ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$targetWorkspace Neos\ContentRepository\Domain\Model\Workspace
return void

getUnpublishedNodes() public method

Returns a list of nodes contained in the given workspace which are not yet published
public getUnpublishedNodes ( Workspace $workspace ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface>
$workspace Neos\ContentRepository\Domain\Model\Workspace
return array<\Neos\ContentRepository\Domain\Model\NodeInterface>

getUnpublishedNodesCount() public method

Returns the number of unpublished nodes contained in the given workspace
public getUnpublishedNodesCount ( Workspace $workspace ) : integer
$workspace Neos\ContentRepository\Domain\Model\Workspace
return integer

publishNode() public method

Publishes the given node to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
public publishNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $targetWorkspace = null ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface
$targetWorkspace Neos\ContentRepository\Domain\Model\Workspace If not set the base workspace is assumed to be the publishing target
return void

publishNodes() public method

Publishes the given nodes to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
public publishNodes ( array $nodes, Workspace $targetWorkspace = null ) : void
$nodes array
$targetWorkspace Neos\ContentRepository\Domain\Model\Workspace If not set the base workspace is assumed to be the publishing target
return void

sortNodesForPublishing() protected method

Sort an unsorted list of nodes in a publishable order
protected sortNodesForPublishing ( array $nodes ) : array
$nodes array Unsorted list of nodes (unpublished nodes)
return array Sorted list of nodes for publishing

Property Details

$contentDimensionPresetSource protected_oe property

protected ContentDimensionPresetSourceInterface,Neos\ContentRepository\Domain\Service $contentDimensionPresetSource
return Neos\ContentRepository\Domain\Service\ContentDimensionPresetSourceInterface

$contextFactory protected_oe property

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $contextFactory
return Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$nodeDataRepository protected_oe property

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
return Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeFactory protected_oe property

protected NodeFactory,Neos\ContentRepository\Domain\Factory $nodeFactory
return Neos\ContentRepository\Domain\Factory\NodeFactory

$workspaceRepository protected_oe property

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
return Neos\ContentRepository\Domain\Repository\WorkspaceRepository