PHP Класс Neos\ContentRepository\Domain\Model\NodeData

NOTE: This is internal only and should not be used or extended by userland code.
Наследование: extends AbstractNodeData
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
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

Описание методов

__clone() публичный Метод

Create a fresh collection instance and clone dimensions
public __clone ( ) : void
Результат void

__construct() публичный Метод

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() защищенный Метод

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() защищенный Метод

Build a cached array of dimension values and a hash to search for it.
protected buildDimensionValues ( ) : void
Результат void

calculateParentPathHash() защищенный Метод

Calculates the hash corresponding to the dimensions and their values for this instance.
protected calculateParentPathHash ( ) : void
Результат void

calculatePathHash() защищенный Метод

Calculates the hash corresponding to the path of this instance.
protected calculatePathHash ( ) : void
Результат void

createNodeData() публичный Метод

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
Результат NodeData

createNodeDataFromTemplate() публичный Метод

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
Результат NodeData the freshly generated node

createShadow() публичный Метод

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
Результат NodeData

createSingleNodeData() публичный Метод

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
Результат NodeData

emitNodePathChanged() защищенный Метод

Signals that a node has changed its path.
protected emitNodePathChanged ( NodeData $nodeData ) : void
$nodeData NodeData the node data instance that has been changed
Результат void

findExistingDimensionMatching() защищенный Метод

Internal method used in setDimensions to reuse dimension objects with the same name/value pair.
См. также: setDimensions
protected findExistingDimensionMatching ( NodeDimension $dimensionToBeSet ) : NodeDimension | null
$dimensionToBeSet NodeDimension
Результат NodeDimension | null

getChildNodeData() защищенный Метод

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>
Результат array<\Neos\ContentRepository\Domain\Model\NodeData>

getContextPath() публичный Метод

Example: /sites/mysitecom/homepage/about@user-admin
public getContextPath ( ) : string
Результат string Node path with context information

getDepth() публичный Метод

Counting starts with 0 for "/", 1 for "/foo", 2 for "/foo/bar" etc.
public getDepth ( ) : integer
Результат integer

getDimensionValues() публичный Метод

Returns the dimensions and their values.
public getDimensionValues ( ) : array
Результат array

getDimensions() публичный Метод

Internal use, do not retrieve collection directly
public getDimensions ( ) : array
Результат array

getDimensionsHash() публичный Метод

Internal method
public getDimensionsHash ( ) : string
Результат string

getExistingShadowNodeData() защищенный Метод

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
Результат NodeData | null

getIdentifier() публичный Метод

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
Результат string the node's UUID

getIndex() публичный Метод

Returns the index of this node which determines the order among siblings with the same parent node.
public getIndex ( ) : integer
Результат integer

getMovedTo() публичный Метод

public getMovedTo ( ) : NodeData
Результат NodeData

getName() публичный Метод

Returns the name of this node
public getName ( ) : string
Результат string

getNumberOfChildNodes() публичный Метод

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
Результат integer The number of child nodes

getParent() публичный Метод

Returns the parent node of this node
public getParent ( ) : NodeData
Результат NodeData The parent node or NULL if this is the root node

getParentPath() публичный Метод

Returns the parent node path
public getParentPath ( ) : string
Результат string Absolute node path of the parent node

getPath() публичный Метод

Example: /sites/mysitecom/homepage/about
public getPath ( ) : string
Результат string The absolute node path

getWorkspace() публичный Метод

Returns the workspace this node is contained in
public getWorkspace ( ) : Workspace
Результат Workspace

hasAccessRestrictions() публичный Метод

Tells if a node, in general, has access restrictions, independent of the current security context.
public hasAccessRestrictions ( ) : boolean
Результат boolean

isAccessible() публичный Метод

Tells if this node may be accessed according to the current security context.
public isAccessible ( ) : boolean
Результат boolean

isInternal() публичный Метод

An internal NodeData should never produce a Node object.
public isInternal ( ) : boolean
Результат boolean

isRemoved() публичный Метод

If this node is a removed node.
public isRemoved ( ) : boolean
Результат boolean

isVisible() публичный Метод

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
Результат boolean

matchesWorkspaceAndDimensions() публичный Метод

Checks if this instance matches the given workspace and dimensions.
public matchesWorkspaceAndDimensions ( Workspace $workspace, array $dimensions = null ) : boolean
$workspace Workspace
$dimensions array
Результат boolean

materializeToWorkspace() защищенный Метод

This is only used in setPath for now
protected materializeToWorkspace ( Workspace $workspace ) : NodeData
$workspace Workspace
Результат NodeData

move() публичный Метод

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
Результат NodeData If a shadow node was created this is the new NodeData object after the move.

remove() публичный Метод

Removes this node and all its child nodes. This is an alias for setRemoved(TRUE)
public remove ( ) : void
Результат void

setAsShadowOf() защищенный Метод

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
Результат void

setDimensions() публичный Метод

Internal use, do not manipulate collection directly
public setDimensions ( array $dimensionsToBeSet ) : void
$dimensionsToBeSet array
Результат void

setIdentifier() публичный Метод

NOTE: This is only used for some very rare cases (to replace existing instances when moving).
public setIdentifier ( string $identifier ) : void
$identifier string
Результат void

setIndex() публичный Метод

Sets the index of this node
public setIndex ( integer $index ) : void
$index integer The new index
Результат void

setMovedTo() публичный Метод

public setMovedTo ( NodeData $nodeData = null ) : void
$nodeData NodeData
Результат void

setPath() публичный Метод

Sets the absolute path of this node
public setPath ( string $path, boolean $recursive = true ) : void
$path string
$recursive boolean
Результат void

setRemoved() публичный Метод

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.
Результат void

setWorkspace() публичный Метод

Sets the workspace of this node.
public setWorkspace ( Workspace $workspace = null ) : void
$workspace Workspace
Результат void

similarize() публичный Метод

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
Результат void

updateContentObject() защищенный Метод

Updates the attached content object
protected updateContentObject ( object $contentObject ) : void
$contentObject object
Результат void

Описание свойств

$contentObjectProxy защищенное свойство

Optional proxy for a content object which acts as an alternative property container
protected ContentObjectProxy,Neos\ContentRepository\Domain\Model $contentObjectProxy
Результат ContentObjectProxy

$depth защищенное свойство

Level number within the global node tree
protected int $depth
Результат integer

$dimensionValues защищенное свойство

protected array $dimensionValues
Результат array

$dimensions защищенное свойство

protected NodeDimension>,Doctrine\Common\Collections\Collection<\Neos\ContentRepository\Domain\Model $dimensions
Результат Doctrine\Common\Collections\Collection<\Neos\ContentRepository\Domain\Model\NodeDimension>

$dimensionsHash защищенное свойство

MD5 hash of the content dimensions The hash is generated in buildDimensionValues().
protected string $dimensionsHash
Результат string

$hiddenAfterDateTime защищенное свойство

protected DateTime $hiddenAfterDateTime
Результат DateTime

$hiddenBeforeDateTime защищенное свойство

protected DateTime $hiddenBeforeDateTime
Результат DateTime

$identifier защищенное свойство

Identifier of this node which is unique within its workspace
protected string $identifier
Результат string

$index защищенное свойство

Index within the nodes with the same parent
protected int $index
Результат integer

$lastModificationDateTime защищенное свойство

protected DateTime $lastModificationDateTime
Результат DateTime

$lastPublicationDateTime защищенное свойство

protected DateTime $lastPublicationDateTime
Результат DateTime

$movedTo защищенное свойство

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
Результат NodeData

$name защищенное свойство

Node name, derived from its node path
protected string $name
Результат string

$nodeService защищенное свойство

protected NodeServiceInterface,Neos\ContentRepository\Domain\Service $nodeService
Результат Neos\ContentRepository\Domain\Service\NodeServiceInterface

$parentPath защищенное свойство

Absolute path of the parent path
protected string $parentPath
Результат string

$parentPathHash защищенное свойство

The hash is generated in calculateParentPathHash().
protected string $parentPathHash
Результат string

$path защищенное свойство

Absolute path of this node
protected string $path
Результат string

$pathHash защищенное свойство

The hash is generated in calculatePathHash().
protected string $pathHash
Результат string

$removed защищенное свойство

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
Результат boolean

$securityContext защищенное свойство

protected Context,Neos\Flow\Security $securityContext
Результат Neos\Flow\Security\Context

$version защищенное свойство

Auto-incrementing version of this node data, used for optimistic locking
protected int $version
Результат integer

$workspace защищенное свойство

Workspace this node is contained in
protected Workspace,Neos\ContentRepository\Domain\Model $workspace
Результат Workspace