NodePublishingDependencySolver
class NodePublishingDependencySolver (View source)
Solve / sort nodes by dependencies for publishing
Properties
protected array | $nodesByPath | ||
protected array | $nodesByNodeData | ||
protected array | $dependenciesOutgoing | ||
protected array | $dependenciesIncoming | ||
protected array | $nodesWithoutIncoming |
Methods
array
sort(array $nodes)
Sort nodes by an order suitable for publishing
buildNodeDependencies(array $nodes)
Prepare dependencies for the given list of nodes
array
resolveDependencies()
Resolve node dependencies
Details
array
sort(array $nodes)
Sort nodes by an order suitable for publishing
This makes sure all parent and moved-to relations are resolved and changes that need to be published before other changes will be published first.
Uses topological sorting of node dependencies (http://en.wikipedia.org/wiki/Topological_sorting) to build a publishable order of nodes.
protected
buildNodeDependencies(array $nodes)
Prepare dependencies for the given list of nodes
protected array
resolveDependencies()
Resolve node dependencies
- Pick a node from the set of nodes without incoming dependencies
- For all dependencies of that node: 2a. Remove the dependency 2b. If the dependency has no other incoming dependencies itself, add it to the set of nodes without incoming dependencies