PHP 클래스 Neos\ContentRepository\Domain\Model\NodeData

NOTE: This is internal only and should not be used or extended by userland code.
상속: extends AbstractNodeData
파일 보기 프로젝트 열기: neos/neos-development-collection 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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