PHP Class Neos\ContentRepository\Command\NodeCommandControllerPlugin

Inheritance: implements Neos\ContentRepository\Command\NodeCommandControllerPluginInterface
Afficher le fichier Open project: neos/neos-development-collection

Protected Properties

Свойство Type Description
$contentDimensionCombinator Neos\ContentRepository\Domain\Service\ContentDimensionCombinator
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$entityManager Doctrine\Common\Persistence\ObjectManager ..
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeFactory Neos\ContentRepository\Domain\Factory\NodeFactory
$nodeTypeManager Neos\ContentRepository\Domain\Service\NodeTypeManager
$output Neos\Flow\Cli\ConsoleOutput
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$pluginConfigurations array
$propertyMapper Neos\Flow\Property\PropertyMapper
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

Méthodes publiques

Méthode Description
addMissingDefaultValues ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void Performs checks for unset properties that has default values and sets them if necessary.
addMissingDefaultValuesByNodeType ( NodeType $nodeType = null, string $workspaceName, boolean $dryRun ) : void Adds missing default values for the given node type
fixNodesWithInconsistentIdentifier ( string $workspaceName, boolean $dryRun ) : void Detect and fix nodes in non-live workspaces whose identifier does not match their corresponding node in the live workspace.
getSubCommandDescription ( string $controllerCommandName ) : string Returns a piece of description for the specific task the plugin solves for the specified command
getSubCommandShortDescription ( string $controllerCommandName ) : string Returns a short description
invokeSubCommand ( string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', boolean $dryRun = false, boolean $cleanup = true, string $skip = null, string $only = null ) : void A method which runs the task implemented by the plugin for the given command
removeBrokenEntityReferences ( string $workspaceName, boolean $dryRun ) : void Remove broken entity references
removeNodesWithInvalidDimensions ( string $workspaceName, boolean $dryRun ) : void Remove nodes with invalid dimension values
removeNodesWithInvalidWorkspace ( string $workspaceName, boolean $dryRun ) : void Remove nodes with invalid workspace
removeUndefinedProperties ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void Performs checks for orphan nodes removes them if found.

Méthodes protégées

Méthode Description
askBeforeExecutingTask ( string $question, Closure $task ) : void
collectNodesWithInvalidDimensions ( string $workspaceName, array $allowedDimensionCombinations ) : array Collects all nodes of the given node type which have dimension values not fitting to the current dimension configuration.
collectNodesWithInvalidWorkspace ( ) : array Collects all nodes of the given node type which refer to an invalid workspace configuration.
createChildNodesByNodeType ( NodeType $nodeType, string $workspaceName, boolean $dryRun ) : void Create missing child nodes for the given node type
createContext ( string $workspaceName, array $dimensions ) : Context Creates a content context for given workspace
createMissingChildNodes ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void Performs checks for missing child nodes according to the node's auto-create configuration and creates them if necessary.
fixShadowNodesInWorkspace ( Workspace $workspace, boolean $dryRun, NodeType $nodeType = null ) : array Collects all nodes with missing shadow nodes
getNodeDataByNodeTypeAndWorkspace ( string $nodeType, string $workspaceName ) : array Retrieves all NodeData objects of a certain node type inside a given workspace.
removeAbstractAndUndefinedNodes ( string $workspaceName, boolean $dryRun ) : void Performs checks for nodes with abstract or undefined node types and removes them if found.
removeDisallowedChildNodes ( string $workspaceName, boolean $dryRun ) : void Performs checks for disallowed child nodes according to the node's auto-create configuration and constraints and removes them if found.
removeNode ( string $nodeIdentifier, string $dimensionsHash ) Removes the specified node (exactly that one)
removeNodeAndChildNodesInWorkspaceByPath ( string $nodePath, string $workspaceName ) Removes all nodes with a specific path and their children in the given workspace.
removeOrphanNodes ( string $workspaceName, boolean $dryRun ) : void Performs checks for orphan nodes removes them if found.
reorderChildNodes ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void Reorder child nodes according to the current position configuration of child nodes.
reorderChildNodesByNodeType ( string $workspaceName, boolean $dryRun, NodeType $nodeType ) : void Reorder child nodes for the given node type
repairShadowNodes ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void Repair nodes whose shadow nodes are missing

Method Details

addMissingDefaultValues() public méthode

Performs checks for unset properties that has default values and sets them if necessary.
public addMissingDefaultValues ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void
$workspaceName string Name of the workspace to consider
$dryRun boolean Simulate?
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only for this node type, if specified
Résultat void

addMissingDefaultValuesByNodeType() public méthode

Adds missing default values for the given node type
public addMissingDefaultValuesByNodeType ( NodeType $nodeType = null, string $workspaceName, boolean $dryRun ) : void
$nodeType Neos\ContentRepository\Domain\Model\NodeType
$workspaceName string
$dryRun boolean
Résultat void

askBeforeExecutingTask() protected méthode

protected askBeforeExecutingTask ( string $question, Closure $task ) : void
$question string
$task Closure
Résultat void

collectNodesWithInvalidDimensions() protected méthode

Collects all nodes of the given node type which have dimension values not fitting to the current dimension configuration.
protected collectNodesWithInvalidDimensions ( string $workspaceName, array $allowedDimensionCombinations ) : array
$workspaceName string
$allowedDimensionCombinations array
Résultat array

collectNodesWithInvalidWorkspace() protected méthode

Note: due to the foreign key constraints in the database, there actually never should be any node with n.workspace of a non-existing workspace because if that workspace does not exist anymore, the value would turn NULL. But the query covers this nevertheless. Better safe than sorry.
protected collectNodesWithInvalidWorkspace ( ) : array
Résultat array

createChildNodesByNodeType() protected méthode

Create missing child nodes for the given node type
protected createChildNodesByNodeType ( NodeType $nodeType, string $workspaceName, boolean $dryRun ) : void
$nodeType Neos\ContentRepository\Domain\Model\NodeType
$workspaceName string
$dryRun boolean
Résultat void

createContext() protected méthode

Creates a content context for given workspace
protected createContext ( string $workspaceName, array $dimensions ) : Context
$workspaceName string
$dimensions array
Résultat Neos\ContentRepository\Domain\Service\Context

createMissingChildNodes() protected méthode

Performs checks for missing child nodes according to the node's auto-create configuration and creates them if necessary.
protected createMissingChildNodes ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void
$workspaceName string Name of the workspace to consider
$dryRun boolean Simulate?
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only for this node type, if specified
Résultat void

fixNodesWithInconsistentIdentifier() public méthode

Detect and fix nodes in non-live workspaces whose identifier does not match their corresponding node in the live workspace.
public fixNodesWithInconsistentIdentifier ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string This argument will be ignored
$dryRun boolean Simulate?
Résultat void

fixShadowNodesInWorkspace() protected méthode

Collects all nodes with missing shadow nodes
protected fixShadowNodesInWorkspace ( Workspace $workspace, boolean $dryRun, NodeType $nodeType = null ) : array
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dryRun boolean
$nodeType Neos\ContentRepository\Domain\Model\NodeType
Résultat array

getNodeDataByNodeTypeAndWorkspace() protected méthode

Shadow nodes are excluded, because they will be published when publishing the moved node.
protected getNodeDataByNodeTypeAndWorkspace ( string $nodeType, string $workspaceName ) : array
$nodeType string
$workspaceName string
Résultat array

getSubCommandDescription() public static méthode

Returns a piece of description for the specific task the plugin solves for the specified command
public static getSubCommandDescription ( string $controllerCommandName ) : string
$controllerCommandName string Name of the command in question, for example "repair"
Résultat string A piece of text to be included in the overall description of the node:xy command

getSubCommandShortDescription() public static méthode

Returns a short description
public static getSubCommandShortDescription ( string $controllerCommandName ) : string
$controllerCommandName string Name of the command in question, for example "repair"
Résultat string A piece of text to be included in the overall description of the node:xy command

invokeSubCommand() public méthode

A method which runs the task implemented by the plugin for the given command
public invokeSubCommand ( string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', boolean $dryRun = false, boolean $cleanup = true, string $skip = null, string $only = null ) : void
$controllerCommandName string Name of the command in question, for example "repair"
$output Neos\Flow\Cli\ConsoleOutput An instance of ConsoleOutput which can be used for output or dialogues
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only handle this node type (if specified)
$workspaceName string Only handle this workspace (if specified)
$dryRun boolean If TRUE, don't do any changes, just simulate what you would do
$cleanup boolean If FALSE, cleanup tasks are skipped
$skip string Skip the given check or checks (comma separated)
$only string Only execute the given check or checks (comma separated)
Résultat void

removeAbstractAndUndefinedNodes() protected méthode

Performs checks for nodes with abstract or undefined node types and removes them if found.
protected removeAbstractAndUndefinedNodes ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string
$dryRun boolean Simulate?
Résultat void

removeBrokenEntityReferences() public méthode

This removes references from nodes to entities which don't exist anymore.
public removeBrokenEntityReferences ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string
$dryRun boolean
Résultat void

removeDisallowedChildNodes() protected méthode

Performs checks for disallowed child nodes according to the node's auto-create configuration and constraints and removes them if found.
protected removeDisallowedChildNodes ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string
$dryRun boolean Simulate?
Résultat void

removeNode() protected méthode

Removes the specified node (exactly that one)
protected removeNode ( string $nodeIdentifier, string $dimensionsHash )
$nodeIdentifier string
$dimensionsHash string

removeNodeAndChildNodesInWorkspaceByPath() protected méthode

Removes all nodes with a specific path and their children in the given workspace.
protected removeNodeAndChildNodesInWorkspaceByPath ( string $nodePath, string $workspaceName )
$nodePath string
$workspaceName string

removeNodesWithInvalidDimensions() public méthode

This removes nodes which have dimension values not fitting to the current dimension configuration
public removeNodesWithInvalidDimensions ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string Name of the workspace to consider
$dryRun boolean Simulate?
Résultat void

removeNodesWithInvalidWorkspace() public méthode

This removes nodes which refer to a workspace which does not exist.
public removeNodesWithInvalidWorkspace ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string This argument will be ignored
$dryRun boolean Simulate?
Résultat void

removeOrphanNodes() protected méthode

Performs checks for orphan nodes removes them if found.
protected removeOrphanNodes ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string
$dryRun boolean Simulate?
Résultat void

removeUndefinedProperties() public méthode

Performs checks for orphan nodes removes them if found.
public removeUndefinedProperties ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void
$workspaceName string
$dryRun boolean Simulate?
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only for this node type, if specified
Résultat void

reorderChildNodes() protected méthode

Reorder child nodes according to the current position configuration of child nodes.
protected reorderChildNodes ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void
$workspaceName string Name of the workspace to consider
$dryRun boolean Simulate?
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only for this node type, if specified
Résultat void

reorderChildNodesByNodeType() protected méthode

Reorder child nodes for the given node type
protected reorderChildNodesByNodeType ( string $workspaceName, boolean $dryRun, NodeType $nodeType ) : void
$workspaceName string
$dryRun boolean
$nodeType Neos\ContentRepository\Domain\Model\NodeType
Résultat void

repairShadowNodes() protected méthode

This check searches for nodes which have a corresponding node in one of the base workspaces, have different node paths, but don't have a corresponding shadow node with a "movedto" value.
protected repairShadowNodes ( string $workspaceName, boolean $dryRun, NodeType $nodeType = null ) : void
$workspaceName string Currently ignored
$dryRun boolean Simulate?
$nodeType Neos\ContentRepository\Domain\Model\NodeType This argument will be ignored
Résultat void

Property Details

$contentDimensionCombinator protected_oe property

protected ContentDimensionCombinator,Neos\ContentRepository\Domain\Service $contentDimensionCombinator
Résultat Neos\ContentRepository\Domain\Service\ContentDimensionCombinator

$contextFactory protected_oe property

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $contextFactory
Résultat Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$entityManager protected_oe property

..
protected ObjectManager,Doctrine\Common\Persistence $entityManager
Résultat Doctrine\Common\Persistence\ObjectManager

$nodeDataRepository protected_oe property

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
Résultat Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeFactory protected_oe property

protected NodeFactory,Neos\ContentRepository\Domain\Factory $nodeFactory
Résultat Neos\ContentRepository\Domain\Factory\NodeFactory

$nodeTypeManager protected_oe property

protected NodeTypeManager,Neos\ContentRepository\Domain\Service $nodeTypeManager
Résultat Neos\ContentRepository\Domain\Service\NodeTypeManager

$output protected_oe property

protected ConsoleOutput,Neos\Flow\Cli $output
Résultat Neos\Flow\Cli\ConsoleOutput

$persistenceManager protected_oe property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
Résultat Neos\Flow\Persistence\PersistenceManagerInterface

$pluginConfigurations protected_oe property

protected array $pluginConfigurations
Résultat array

$propertyMapper protected_oe property

protected PropertyMapper,Neos\Flow\Property $propertyMapper
Résultat Neos\Flow\Property\PropertyMapper

$workspaceRepository protected_oe property

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
Résultat Neos\ContentRepository\Domain\Repository\WorkspaceRepository