PublishingService
class PublishingService implements PublishingServiceInterface (View source)
A generic ContentRepository Publishing Service
Properties
protected WorkspaceRepository | $workspaceRepository | ||
protected NodeDataRepository | $nodeDataRepository | ||
protected NodeFactory | $nodeFactory | ||
protected ContextFactoryInterface | $contextFactory | ||
protected ContentDimensionPresetSourceInterface | $contentDimensionPresetSource |
Methods
Returns a list of nodes contained in the given workspace which are not yet published
Returns the number of unpublished nodes contained in the given workspace
Publishes the given node to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
Publishes the given nodes to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
Method which does the actual work of discarding, includes a protection against endless recursions and multiple discarding of the same node.
Discards the given nodes.
Sort an unsorted list of nodes in a publishable order
Signals that a node has been published.
Creates a new content context based on the given workspace and the NodeData object.
Details
NodeInterface[]
getUnpublishedNodes(Workspace $workspace)
Returns a list of nodes contained in the given workspace which are not yet published
int
getUnpublishedNodesCount(Workspace $workspace)
Returns the number of unpublished nodes contained in the given workspace
void
publishNode(NodeInterface $node, Workspace $targetWorkspace = null)
Publishes the given node to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
void
publishNodes(array $nodes, Workspace $targetWorkspace = null)
Publishes the given nodes to the specified target workspace. If no workspace is specified, the source workspace's base workspace is assumed.
void
discardNode(NodeInterface $node)
Discards the given node.
If the node has been moved, this method will also discard all changes of child nodes of the given node.
protected void
doDiscardNode(NodeInterface $node, array $alreadyDiscardedNodeIdentifiers = [])
Method which does the actual work of discarding, includes a protection against endless recursions and multiple discarding of the same node.
void
discardNodes(array $nodes)
Discards the given nodes.
void
discardAllNodes(Workspace $workspace)
Discards all unpublished nodes of the given workspace.
TODO: This method needs to be optimized / implemented in collaboration with a DQL-based method in NodeDataRepository
protected array
sortNodesForPublishing(array $nodes)
Sort an unsorted list of nodes in a publishable order
void
emitNodePublished(NodeInterface $node, Workspace $targetWorkspace = null)
Signals that a node has been published.
The signal emits the source node and target workspace, i.e. the node contains its source workspace.
void
emitNodeDiscarded(NodeInterface $node)
Signals that a node has been discarded.
The signal emits the node that has been discarded.