PublishingService
class PublishingService extends PublishingService (View source)
The workspaces service adds some basic helper methods for getting workspaces, unpublished nodes and methods for publishing nodes or whole workspaces.
Properties
protected WorkspaceRepository | $workspaceRepository | from PublishingService | |
protected NodeDataRepository | $nodeDataRepository | from PublishingService | |
protected NodeFactory | $nodeFactory | from PublishingService | |
protected ContextFactoryInterface | $contextFactory | from PublishingService | |
protected ContentDimensionPresetSourceInterface | $contentDimensionPresetSource | from PublishingService |
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 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.
Signals that a node has been discarded.
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 base workspace is assumed.
If the given node is a Document or has ContentCollection child nodes, these nodes are published as well.
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 from its workspace.
If the given node is a Document or has ContentCollection child nodes, these nodes are discarded as well.
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, Workspace|null $baseWorkspace = null)
Signals that a node has been discarded.
The signal emits the node that has been discarded.
protected Context
createContext(Workspace $workspace, array $dimensionValues, array $contextProperties = [])
Creates a new content context based on the given workspace and the NodeData object.
protected array
collectAllContentChildNodes(NodeInterface $parentNode, array $collectedNodes = [])
No description