PHP Class Neos\ContentRepository\Domain\Model\NodeData

NOTE: This is internal only and should not be used or extended by userland code.
Inheritance: extends AbstractNodeData
Afficher le fichier Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Свойство Type Description
$contentObjectProxy ContentObjectProxy Optional proxy for a content object which acts as an alternative property container
$depth integer Level number within the global node tree
$dimensionValues array
$dimensions Doctrine\Common\Collections\Collection<\Neos\ContentRepository\Domain\Model\NodeDimension>
$dimensionsHash string MD5 hash of the content dimensions The hash is generated in buildDimensionValues().
$hiddenAfterDateTime DateTime
$hiddenBeforeDateTime DateTime
$identifier string Identifier of this node which is unique within its workspace
$index integer Index within the nodes with the same parent
$lastModificationDateTime DateTime
$lastPublicationDateTime DateTime
$movedTo NodeData If a node data is moved a "shadow" node data is inserted that references the new node data
$name string Node name, derived from its node path
$nodeService Neos\ContentRepository\Domain\Service\NodeServiceInterface
$parentPath string Absolute path of the parent path
$parentPathHash string The hash is generated in calculateParentPathHash().
$path string Absolute path of this node
$pathHash string The hash is generated in calculatePathHash().
$removed boolean If this is a removed node. This flag can and is only used in workspaces which do have a base workspace. In a bottom level workspace nodes are really removed, in other workspaces, removal is realized by this flag.
$securityContext Neos\Flow\Security\Context
$version integer Auto-incrementing version of this node data, used for optimistic locking
$workspace Workspace Workspace this node is contained in

Méthodes publiques

Méthode Description
__clone ( ) : void Create a fresh collection instance and clone dimensions
__construct ( string $path, Workspace $workspace, string $identifier = null, array $dimensions = null ) Constructs this node data container
createNodeData ( string $name, NodeType $nodeType = null, string $identifier = null, Workspace $workspace = null, array $dimensions = null ) : NodeData Creates, adds and returns a child node of this node. Also sets default properties and creates default subnodes.
createNodeDataFromTemplate ( NodeTemplate $nodeTemplate, string $nodeName = null, Workspace $workspace = null, array $dimensions = null ) : NodeData Creates and persists a node from the given $nodeTemplate as child node
createShadow ( string $path ) : NodeData Create a shadow NodeData at the given path with the same workspace and dimensions as this
createSingleNodeData ( string $name, NodeType $nodeType = null, string $identifier = null, Workspace $workspace = null, array $dimensions = null ) : NodeData Creates, adds and returns a child node of this node, without setting default properties or creating subnodes.
getContextPath ( ) : string Returns the absolute path of this node with additional context information (such as the workspace name).
getDepth ( ) : integer Returns the level at which this node is located.
getDimensionValues ( ) : array Returns the dimensions and their values.
getDimensions ( ) : array Internal use, do not retrieve collection directly
getDimensionsHash ( ) : string Get a unique string for all dimension values
getIdentifier ( ) : string Returns the identifier of this node.
getIndex ( ) : integer Returns the index of this node which determines the order among siblings with the same parent node.
getMovedTo ( ) : NodeData
getName ( ) : string Returns the name of this node
getNumberOfChildNodes ( string $nodeTypeFilter = null, Workspace $workspace, array $dimensions ) : integer Returns the number of child nodes a similar getChildNodes() call would return.
getParent ( ) : NodeData Returns the parent node of this node
getParentPath ( ) : string Returns the parent node path
getPath ( ) : string Returns the path of this node
getWorkspace ( ) : Workspace Returns the workspace this node is contained in
hasAccessRestrictions ( ) : boolean Tells if a node, in general, has access restrictions, independent of the current security context.
isAccessible ( ) : boolean Tells if this node may be accessed according to the current security context.
isInternal ( ) : boolean Check if this NodeData object is a purely internal technical object (like a shadow node).
isRemoved ( ) : boolean If this node is a removed node.
isVisible ( ) : boolean Tells if this node is "visible".
matchesWorkspaceAndDimensions ( Workspace $workspace, array $dimensions = null ) : boolean Checks if this instance matches the given workspace and dimensions.
move ( string $path, Workspace $workspace ) : NodeData Move this NodeData to the given path and workspace.
remove ( ) : void Removes this node and all its child nodes. This is an alias for setRemoved(TRUE)
setDimensions ( array $dimensionsToBeSet ) : void Internal use, do not manipulate collection directly
setIdentifier ( string $identifier ) : void Change the identifier of this node data
setIndex ( integer $index ) : void Sets the index of this node
setMovedTo ( NodeData $nodeData = null ) : void
setPath ( string $path, boolean $recursive = true ) : void Sets the absolute path of this node
setRemoved ( boolean $removed ) : void Enables using the remove method when only setters are available
setWorkspace ( Workspace $workspace = null ) : void Sets the workspace of this node.
similarize ( AbstractNodeData $sourceNode, boolean $isCopy = false ) : void Make the node "similar" to the given source node. That means, - all properties - index - node type - content object will be set to the same values as in the source node.

Méthodes protégées

Méthode Description
addOrUpdate ( NodeData $nodeData = null ) Adds this node to the Node Repository or updates it if it has been added earlier
buildDimensionValues ( ) : void Build a cached array of dimension values and a hash to search for it.
calculateParentPathHash ( ) : void Calculates the hash corresponding to the dimensions and their values for this instance.
calculatePathHash ( ) : void Calculates the hash corresponding to the path of this instance.
emitNodePathChanged ( NodeData $nodeData ) : void Signals that a node has changed its path.
findExistingDimensionMatching ( NodeDimension $dimensionToBeSet ) : NodeDimension | null Internal method used in setDimensions to reuse dimension objects with the same name/value pair.
getChildNodeData ( ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Returns all direct child node data of this node data without reducing the result (multiple variants can be returned)
getExistingShadowNodeData ( string $path, Workspace $workspace, array $dimensionValues ) : NodeData | null Find an existing shadow node data on the given path for the current node data of the node (used by setPath)
materializeToWorkspace ( Workspace $workspace ) : NodeData Materializes the original node data (of a different workspace) into the current workspace, excluding content dimensions
setAsShadowOf ( NodeData $nodeData = null ) : void This becomes a shdow of the given NodeData object.
updateContentObject ( object $contentObject ) : void Updates the attached content object

Method Details

__clone() public méthode

Create a fresh collection instance and clone dimensions
public __clone ( ) : void
Résultat void

__construct() public méthode

Creating new nodes by instantiating NodeData is not part of the public API! The content repository needs to properly integrate new nodes into the node tree and therefore you must use createNode() or createNodeFromTemplate() in a Node object which will internally create a NodeData object.
public __construct ( string $path, Workspace $workspace, string $identifier = null, array $dimensions = null )
$path string Absolute path of this node
$workspace Workspace The workspace this node will be contained in
$identifier string The node identifier (not the persistence object identifier!). Specifying this only makes sense while creating corresponding nodes
$dimensions array An array of dimension name to dimension values

addOrUpdate() protected méthode

Adds this node to the Node Repository or updates it if it has been added earlier
protected addOrUpdate ( NodeData $nodeData = null )
$nodeData NodeData Other NodeData object to addOrUpdate

buildDimensionValues() protected méthode

Build a cached array of dimension values and a hash to search for it.
protected buildDimensionValues ( ) : void
Résultat void

calculateParentPathHash() protected méthode

Calculates the hash corresponding to the dimensions and their values for this instance.
protected calculateParentPathHash ( ) : void
Résultat void

calculatePathHash() protected méthode

Calculates the hash corresponding to the path of this instance.
protected calculatePathHash ( ) : void
Résultat void

createNodeData() public méthode

Creates, adds and returns a child node of this node. Also sets default properties and creates default subnodes.
public createNodeData ( string $name, NodeType $nodeType = null, string $identifier = null, Workspace $workspace = null, array $dimensions = null ) : NodeData
$name string Name of the new node
$nodeType NodeType Node type of the new node (optional)
$identifier string The identifier of the node, unique within the workspace, optional(!)
$workspace Workspace
$dimensions array
Résultat NodeData

createNodeDataFromTemplate() public méthode

Creates and persists a node from the given $nodeTemplate as child node
public createNodeDataFromTemplate ( NodeTemplate $nodeTemplate, string $nodeName = null, Workspace $workspace = null, array $dimensions = null ) : NodeData
$nodeTemplate NodeTemplate
$nodeName string name of the new node. If not specified the name of the nodeTemplate will be used.
$workspace Workspace
$dimensions array
Résultat NodeData the freshly generated node

createShadow() public méthode

Note: The constructor will already add the new object to the repository Internal method, do not use outside of the content repository.
public createShadow ( string $path ) : NodeData
$path string The (original) path for the node data
Résultat NodeData

createSingleNodeData() public méthode

Creates, adds and returns a child node of this node, without setting default properties or creating subnodes.
public createSingleNodeData ( string $name, NodeType $nodeType = null, string $identifier = null, Workspace $workspace = null, array $dimensions = null ) : NodeData
$name string Name of the new node
$nodeType NodeType Node type of the new node (optional)
$identifier string The identifier of the node, unique within the workspace, optional(!)
$workspace Workspace
$dimensions array An array of dimension name to dimension values
Résultat NodeData

emitNodePathChanged() protected méthode

Signals that a node has changed its path.
protected emitNodePathChanged ( NodeData $nodeData ) : void
$nodeData NodeData the node data instance that has been changed
Résultat void

findExistingDimensionMatching() protected méthode

Internal method used in setDimensions to reuse dimension objects with the same name/value pair.
See also: setDimensions
protected findExistingDimensionMatching ( NodeDimension $dimensionToBeSet ) : NodeDimension | null
$dimensionToBeSet NodeDimension
Résultat NodeDimension | null

getChildNodeData() protected méthode

Returns all direct child node data of this node data without reducing the result (multiple variants can be returned)
protected getChildNodeData ( ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
Résultat array<\Neos\ContentRepository\Domain\Model\NodeData>

getContextPath() public méthode

Example: /sites/mysitecom/homepage/about@user-admin
public getContextPath ( ) : string
Résultat string Node path with context information

getDepth() public méthode

Counting starts with 0 for "/", 1 for "/foo", 2 for "/foo/bar" etc.
public getDepth ( ) : integer
Résultat integer

getDimensionValues() public méthode

Returns the dimensions and their values.
public getDimensionValues ( ) : array
Résultat array

getDimensions() public méthode

Internal use, do not retrieve collection directly
public getDimensions ( ) : array
Résultat array

getDimensionsHash() public méthode

Internal method
public getDimensionsHash ( ) : string
Résultat string

getExistingShadowNodeData() protected méthode

Find an existing shadow node data on the given path for the current node data of the node (used by setPath)
protected getExistingShadowNodeData ( string $path, Workspace $workspace, array $dimensionValues ) : NodeData | null
$path string The (new) path of the node data
$workspace Workspace
$dimensionValues array
Résultat NodeData | null

getIdentifier() public méthode

This UUID is not the same as the technical persistence identifier used by Flow's persistence framework. It is an additional identifier which is unique within the same workspace and is used for tracking the same node in across workspaces. It is okay and recommended to use this identifier for synchronisation purposes as it does not change even if all of the nodes content or its path changes.
public getIdentifier ( ) : string
Résultat string the node's UUID

getIndex() public méthode

Returns the index of this node which determines the order among siblings with the same parent node.
public getIndex ( ) : integer
Résultat integer

getMovedTo() public méthode

public getMovedTo ( ) : NodeData
Résultat NodeData

getName() public méthode

Returns the name of this node
public getName ( ) : string
Résultat string

getNumberOfChildNodes() public méthode

Returns the number of child nodes a similar getChildNodes() call would return.
public getNumberOfChildNodes ( string $nodeTypeFilter = null, Workspace $workspace, array $dimensions ) : integer
$nodeTypeFilter string If specified, only nodes with that node type are considered
$workspace Workspace
$dimensions array
Résultat integer The number of child nodes

getParent() public méthode

Returns the parent node of this node
public getParent ( ) : NodeData
Résultat NodeData The parent node or NULL if this is the root node

getParentPath() public méthode

Returns the parent node path
public getParentPath ( ) : string
Résultat string Absolute node path of the parent node

getPath() public méthode

Example: /sites/mysitecom/homepage/about
public getPath ( ) : string
Résultat string The absolute node path

getWorkspace() public méthode

Returns the workspace this node is contained in
public getWorkspace ( ) : Workspace
Résultat Workspace

hasAccessRestrictions() public méthode

Tells if a node, in general, has access restrictions, independent of the current security context.
public hasAccessRestrictions ( ) : boolean
Résultat boolean

isAccessible() public méthode

Tells if this node may be accessed according to the current security context.
public isAccessible ( ) : boolean
Résultat boolean

isInternal() public méthode

An internal NodeData should never produce a Node object.
public isInternal ( ) : boolean
Résultat boolean

isRemoved() public méthode

If this node is a removed node.
public isRemoved ( ) : boolean
Résultat boolean

isVisible() public méthode

For this the "hidden" flag and the "hiddenBeforeDateTime" and "hiddenAfterDateTime" dates are taken into account. The fact that a node is "visible" does not imply that it can / may be shown to the user. Further modifiers such as isAccessible() need to be evaluated.
public isVisible ( ) : boolean
Résultat boolean

matchesWorkspaceAndDimensions() public méthode

Checks if this instance matches the given workspace and dimensions.
public matchesWorkspaceAndDimensions ( Workspace $workspace, array $dimensions = null ) : boolean
$workspace Workspace
$dimensions array
Résultat boolean

materializeToWorkspace() protected méthode

This is only used in setPath for now
protected materializeToWorkspace ( Workspace $workspace ) : NodeData
$workspace Workspace
Résultat NodeData

move() public méthode

Basically 4 scenarios have to be covered here, depending on: - Does the NodeData have to be materialized (adapted to the workspace or target dimension)? - Does a shadow node exist on the target path? Because unique key constraints and Doctrine ORM don't support arbitrary removal and update combinations, existing NodeData instances are re-used and the metadata and content is swapped around.
public move ( string $path, Workspace $workspace ) : NodeData
$path string
$workspace Workspace
Résultat NodeData If a shadow node was created this is the new NodeData object after the move.

remove() public méthode

Removes this node and all its child nodes. This is an alias for setRemoved(TRUE)
public remove ( ) : void
Résultat void

setAsShadowOf() protected méthode

If NULL or no argument is given then movedTo is nulled and removed is set to FALSE effectively turning this into a normal NodeData.
protected setAsShadowOf ( NodeData $nodeData = null ) : void
$nodeData NodeData
Résultat void

setDimensions() public méthode

Internal use, do not manipulate collection directly
public setDimensions ( array $dimensionsToBeSet ) : void
$dimensionsToBeSet array
Résultat void

setIdentifier() public méthode

NOTE: This is only used for some very rare cases (to replace existing instances when moving).
public setIdentifier ( string $identifier ) : void
$identifier string
Résultat void

setIndex() public méthode

Sets the index of this node
public setIndex ( integer $index ) : void
$index integer The new index
Résultat void

setMovedTo() public méthode

public setMovedTo ( NodeData $nodeData = null ) : void
$nodeData NodeData
Résultat void

setPath() public méthode

Sets the absolute path of this node
public setPath ( string $path, boolean $recursive = true ) : void
$path string
$recursive boolean
Résultat void

setRemoved() public méthode

Enables using the remove method when only setters are available
public setRemoved ( boolean $removed ) : void
$removed boolean If TRUE, this node and it's child nodes will be removed. This can handle FALSE as well.
Résultat void

setWorkspace() public méthode

Sets the workspace of this node.
public setWorkspace ( Workspace $workspace = null ) : void
$workspace Workspace
Résultat void

similarize() public méthode

Make the node "similar" to the given source node. That means, - all properties - index - node type - content object will be set to the same values as in the source node.
public similarize ( AbstractNodeData $sourceNode, boolean $isCopy = false ) : void
$sourceNode AbstractNodeData
$isCopy boolean
Résultat void

updateContentObject() protected méthode

Updates the attached content object
protected updateContentObject ( object $contentObject ) : void
$contentObject object
Résultat void

Property Details

$contentObjectProxy protected_oe property

Optional proxy for a content object which acts as an alternative property container
protected ContentObjectProxy,Neos\ContentRepository\Domain\Model $contentObjectProxy
Résultat ContentObjectProxy

$depth protected_oe property

Level number within the global node tree
protected int $depth
Résultat integer

$dimensionValues protected_oe property

protected array $dimensionValues
Résultat array

$dimensions protected_oe property

protected NodeDimension>,Doctrine\Common\Collections\Collection<\Neos\ContentRepository\Domain\Model $dimensions
Résultat Doctrine\Common\Collections\Collection<\Neos\ContentRepository\Domain\Model\NodeDimension>

$dimensionsHash protected_oe property

MD5 hash of the content dimensions The hash is generated in buildDimensionValues().
protected string $dimensionsHash
Résultat string

$hiddenAfterDateTime protected_oe property

protected DateTime $hiddenAfterDateTime
Résultat DateTime

$hiddenBeforeDateTime protected_oe property

protected DateTime $hiddenBeforeDateTime
Résultat DateTime

$identifier protected_oe property

Identifier of this node which is unique within its workspace
protected string $identifier
Résultat string

$index protected_oe property

Index within the nodes with the same parent
protected int $index
Résultat integer

$lastModificationDateTime protected_oe property

protected DateTime $lastModificationDateTime
Résultat DateTime

$lastPublicationDateTime protected_oe property

protected DateTime $lastPublicationDateTime
Résultat DateTime

$movedTo protected_oe property

If a node data is moved a "shadow" node data is inserted that references the new node data
protected NodeData,Neos\ContentRepository\Domain\Model $movedTo
Résultat NodeData

$name protected_oe property

Node name, derived from its node path
protected string $name
Résultat string

$nodeService protected_oe property

protected NodeServiceInterface,Neos\ContentRepository\Domain\Service $nodeService
Résultat Neos\ContentRepository\Domain\Service\NodeServiceInterface

$parentPath protected_oe property

Absolute path of the parent path
protected string $parentPath
Résultat string

$parentPathHash protected_oe property

The hash is generated in calculateParentPathHash().
protected string $parentPathHash
Résultat string

$path protected_oe property

Absolute path of this node
protected string $path
Résultat string

$pathHash protected_oe property

The hash is generated in calculatePathHash().
protected string $pathHash
Résultat string

$removed protected_oe property

If this is a removed node. This flag can and is only used in workspaces which do have a base workspace. In a bottom level workspace nodes are really removed, in other workspaces, removal is realized by this flag.
protected bool $removed
Résultat boolean

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
Résultat Neos\Flow\Security\Context

$version protected_oe property

Auto-incrementing version of this node data, used for optimistic locking
protected int $version
Résultat integer

$workspace protected_oe property

Workspace this node is contained in
protected Workspace,Neos\ContentRepository\Domain\Model $workspace
Résultat Workspace