PHP Class Neos\ContentRepository\Domain\Repository\NodeDataRepository

DO NOT USE outside the ContentRepository package! The ContextFactory can be used to create a Context that allows to find Node instances that act as the public API to the ContentRepository.
Inheritance: extends Neos\Flow\Persistence\Repository
ファイルを表示 Open project: neos/neos-development-collection Class Usage Examples

Protected Properties

Property Type Description
$addedNodes SplObjectStorage
$defaultOrderings array
$entityManager Doctrine\Common\Persistence\ObjectManager ..
$highestIndexCache array
$nodeFactory Neos\ContentRepository\Domain\Factory\NodeFactory
$nodeTypeManager Neos\ContentRepository\Domain\Service\NodeTypeManager
$removedNodes SplObjectStorage
$securityContext Neos\Flow\Security\Context
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method Description
__construct ( ) Constructor
add ( object $object ) : void Adds a NodeData object to this repository.
addNodeTypeFilterConstraintsToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $nodeTypeFilter ) : void Add node type filter constraints to the query builder
countByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $includeRemovedNodes = false ) : integer Counts nodes by its parent and (optionally) by its node type.
countByWorkspace ( Workspace $workspace ) : integer Counts the number of nodes within the specified workspace
findByIdentifierWithoutReduce ( string $identifier, Workspace $workspace ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Find NodeData by identifier path without any dimension reduction
findByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $removedNodes = false, boolean $recursive = false ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Finds nodes by its parent and (optionally) by its node type.
findByParentAndNodeTypeInContext ( string $parentPath, string $nodeTypeFilter, Context $context, boolean $recursive = false ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface> Finds nodes by its parent and (optionally) by its node type given a Context
findByParentAndNodeTypeRecursively ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $removedNodes = false ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Finds recursively nodes by its parent and (optionally) by its node type.
findByParentWithoutReduce ( string $parentPath, Workspace $workspace ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Find NodeData by parent path without any dimension reduction and grouping by identifier
findByPathWithoutReduce ( string $path, Workspace $workspace, boolean $includeRemovedNodes = false, boolean $recursive = false ) : array Find all node data in a path matching the given workspace hierarchy
findByProperties ( string | array $term, string $nodeTypeFilter, Workspace $workspace, array $dimensions, string $pathStartingPoint = null ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Find nodes by a value in properties
findByWorkspace ( Workspace $workspace ) : array Find all NodeData objects inside a given workspace sorted by path to be used in publishing. The order makes sure that parent nodes are published first.
findFirstByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions, boolean $removedNodes = false ) : NodeData Finds a single node by its parent and (optionally) by its node type
findFirstByParentAndNodeTypeInContext ( string $parentPath, string $nodeTypeFilter, Context $context ) : NodeData Finds a single node by its parent and (optionally) by its node type
findNodesByRelatedEntities ( array $relationMap ) : array Searches for possible relations to the given entity identifiers in NodeData.
findOnPath ( string $pathStartingPoint, string $pathEndPoint, Workspace $workspace, array $dimensions = null, boolean $includeRemovedNodes = false, string $nodeTypeFilter = null ) : array<\Neos\ContentRepository\Domain\Model\NodeData> Finds all nodes of the specified workspace lying on the path specified by (and including) the given starting point and end point and (optionally) a node type filter.
findOneByIdentifier ( string $identifier, Workspace $workspace, array $dimensions = null ) : NodeData Finds a node by its identifier and workspace.
findOneByPath ( string $path, Workspace $workspace, array $dimensions = null, boolean | null $removedNodes = false ) : NodeData Find a single node by exact path.
findOneByPathInContext ( string $path, Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface | null Finds a node by its path and context.
findShadowNodeByPath ( string $path, Workspace $workspace, array $dimensions = null ) : NodeData | null Find a shadow node by exact path
flushNodeRegistry ( ) : void Flushes the addedNodes and removedNodes registry.
isInRemovedNodes ( NodeData $nodeData ) : boolean Test if a given NodeData is in the set of removed node data objects
pathExists ( string $nodePath ) : boolean Find out if the given path exists anywhere in the CR. (internal) If you need this functionality use \Neos\ContentRepository\Domain\Service\NodeService::nodePathExistsInAnyContext()
persistEntities ( ) : void Persists all entities managed by the repository and all cascading dependencies
remove ( object $object ) : void Removes an object to the persistence.
removeAllInPath ( string $path ) : void Remove all nodes below a given path. Does not care about workspaces and dimensions.
reset ( ) : void Reset instances (internal).
setNewIndex ( NodeData $node, integer $position, Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode = null ) : void Assigns an index to the given node which reflects the specified position.

Protected Methods

Method Description
addDimensionJoinConstraintsToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, array $dimensions ) : void If $dimensions is not empty, adds join constraints to the given $queryBuilder limiting the query result to matching hits.
addIdentifierConstraintToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $identifier ) : void
addParentPathConstraintToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $parentPath, boolean $recursive = false ) : void
addPathConstraintToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $path, boolean $recursive = false ) : void
collectWorkspaceAndAllBaseWorkspaces ( Workspace $workspace ) : array Returns an array that contains the given workspace and all base (parent) workspaces of it.
createQueryBuilder ( array $workspaces ) : Doctrine\ORM\QueryBuilder
emitRepositoryObjectsPersisted ( ) : void Signals that persistEntities() in this repository finished correctly.
filterNodeDataByBestMatchInContext ( array $nodeDataObjects, Workspace $workspace, array $dimensions, boolean $includeRemovedNodes = false ) : array
filterOutRemovedObjects ( array &$objects ) : void Iterates of the array of objects and removes all those which have recently been removed from the repository, but whose removal has not yet been persisted.
filterRemovedNodes ( array $nodes, boolean | null $removedNodes ) : array Removes NodeData with the removed property set from the given array.
findNextFreeIndexInParentPath ( string $parentPath ) : integer Finds the next free index on the level below the given parent path across all workspaces.
findNextHigherIndex ( string $parentPath, integer $referenceIndex ) : integer Returns the next-higher-index seen from the given reference index in the level below the specified parent path. If no node with a higher than the given index exists at that level, NULL is returned.
findNextLowerIndex ( string $parentPath, integer $referenceIndex ) : integer Returns the next-lower-index seen from the given reference index in the level below the specified parent path. If no node with a lower than the given index exists at that level, the reference index is returned.
findRawNodesByPath ( string $path, Workspace $workspace, array $dimensions = null, boolean $onlyShadowNodes = false ) : array This finds nodes by path and delivers a raw, unfiltered result.
getNodeDataForParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean | null $removedNodes = false, boolean $recursive = false ) : array Internal method
getNodeTypeFilterConstraints ( Neos\Flow\Persistence\QueryInterface $query, $nodeTypeFilter ) : array
getNodeTypeFilterConstraintsForDql ( string $nodeTypeFilter ) : array Generates a two dimensional array with the filters. First level is: 'excludeNodeTypes' 'includeNodeTypes'
openIndexSpace ( string $parentPath, integer $referenceIndex ) Make room in the sortindex-index space of a given path in preparation to inserting a node.
reduceNodeVariantsByWorkspaces ( array $nodes, array $workspaces ) : array Given an array with duplicate nodes (from different workspaces) those are reduced to uniqueness (by node identifier and dimensions hash)
reduceNodeVariantsByWorkspacesAndDimensions ( array $nodes, array $workspaces, array $dimensions ) : array Given an array with duplicate nodes (from different workspaces and dimensions) those are reduced to uniqueness (by node identifier)
setHighestIndexInParentPath ( string $parentPath, integer $highestIndex ) : void
sortNodesByIndex ( array $nodes ) : array Sorts the given nodes by their index

Method Details

__construct() public method

Constructor
public __construct ( )

add() public method

This repository keeps track of added and removed nodes (additionally to the other Unit of Work) in order to find in-memory nodes.
public add ( object $object ) : void
$object object The object to add
return void

addDimensionJoinConstraintsToQueryBuilder() protected method

If $dimensions is not empty, adds join constraints to the given $queryBuilder limiting the query result to matching hits.
protected addDimensionJoinConstraintsToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, array $dimensions ) : void
$queryBuilder Doctrine\ORM\QueryBuilder
$dimensions array
return void

addIdentifierConstraintToQueryBuilder() protected method

protected addIdentifierConstraintToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $identifier ) : void
$queryBuilder Doctrine\ORM\QueryBuilder
$identifier string
return void

addNodeTypeFilterConstraintsToQueryBuilder() public method

Add node type filter constraints to the query builder
public addNodeTypeFilterConstraintsToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $nodeTypeFilter ) : void
$queryBuilder Doctrine\ORM\QueryBuilder
$nodeTypeFilter string
return void

addParentPathConstraintToQueryBuilder() protected method

protected addParentPathConstraintToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $parentPath, boolean $recursive = false ) : void
$queryBuilder Doctrine\ORM\QueryBuilder
$parentPath string
$recursive boolean
return void

addPathConstraintToQueryBuilder() protected method

protected addPathConstraintToQueryBuilder ( Doctrine\ORM\QueryBuilder $queryBuilder, string $path, boolean $recursive = false ) : void
$queryBuilder Doctrine\ORM\QueryBuilder
$path string
$recursive boolean
return void

collectWorkspaceAndAllBaseWorkspaces() protected method

Returns an array that contains the given workspace and all base (parent) workspaces of it.
protected collectWorkspaceAndAllBaseWorkspaces ( Workspace $workspace ) : array
$workspace Neos\ContentRepository\Domain\Model\Workspace
return array

countByParentAndNodeType() public method

NOTE: Only considers persisted nodes!
public countByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $includeRemovedNodes = false ) : integer
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array
$includeRemovedNodes boolean Should removed nodes be included in the result (defaults to FALSE)
return integer The number of nodes a similar call to findByParentAndNodeType() would return without any pending added nodes

countByWorkspace() public method

Note: Also counts removed nodes
public countByWorkspace ( Workspace $workspace ) : integer
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
return integer The number of nodes found

createQueryBuilder() protected method

protected createQueryBuilder ( array $workspaces ) : Doctrine\ORM\QueryBuilder
$workspaces array
return Doctrine\ORM\QueryBuilder

emitRepositoryObjectsPersisted() protected method

Signals that persistEntities() in this repository finished correctly.
protected emitRepositoryObjectsPersisted ( ) : void
return void

filterNodeDataByBestMatchInContext() protected method

protected filterNodeDataByBestMatchInContext ( array $nodeDataObjects, Workspace $workspace, array $dimensions, boolean $includeRemovedNodes = false ) : array
$nodeDataObjects array
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dimensions array
$includeRemovedNodes boolean Should removed nodes be included in the result (defaults to FALSE)
return array

filterOutRemovedObjects() protected method

Technically this is a check of the given array against $this->removedNodes.
protected filterOutRemovedObjects ( array &$objects ) : void
$objects array
return void

filterRemovedNodes() protected method

Removes NodeData with the removed property set from the given array.
protected filterRemovedNodes ( array $nodes, boolean | null $removedNodes ) : array
$nodes array NodeData including removed entries
$removedNodes boolean | null If TRUE the result has ONLY removed nodes. If FALSE removed nodes are NOT inside the result. If NULL the result contains BOTH removed and non-removed nodes.
return array NodeData with removed entries removed

findByIdentifierWithoutReduce() public method

Only used internally for finding whether the node exists in another dimension
public findByIdentifierWithoutReduce ( string $identifier, Workspace $workspace ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$identifier string
$workspace Neos\ContentRepository\Domain\Model\Workspace
return array<\Neos\ContentRepository\Domain\Model\NodeData>

findByParentAndNodeType() public method

If the $recursive flag is set to TRUE, all matching nodes underneath $parentPath will be returned Note: Filters out removed nodes. The primary sort key is the *index*, the secondary sort key (if indices are equal, which only occurs in very rare cases) is the *identifier*.
public findByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $removedNodes = false, boolean $recursive = false ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array An array of dimensions to dimension values
$removedNodes boolean If TRUE the result has ONLY removed nodes. If FALSE removed nodes are NOT inside the result. If NULL the result contains BOTH removed and non-removed nodes. (defaults to FALSE)
$recursive boolean If TRUE *all* matching nodes underneath the specified parent path are returned
return array<\Neos\ContentRepository\Domain\Model\NodeData>

findByParentAndNodeTypeInContext() public method

TODO Move to a new Node operation getDescendantNodes(...)
public findByParentAndNodeTypeInContext ( string $parentPath, string $nodeTypeFilter, Context $context, boolean $recursive = false ) : array<\Neos\ContentRepository\Domain\Model\NodeInterface>
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$context Neos\ContentRepository\Domain\Service\Context The containing workspace
$recursive boolean If TRUE *all* matching nodes underneath the specified parent path are returned
return array<\Neos\ContentRepository\Domain\Model\NodeInterface>

findByParentAndNodeTypeRecursively() public method

Finds recursively nodes by its parent and (optionally) by its node type.
See also: findByParentAndNodeType()
public findByParentAndNodeTypeRecursively ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean $removedNodes = false ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array An array of dimensions to dimension values
$removedNodes boolean If TRUE the result has ONLY removed nodes. If FALSE removed nodes are NOT inside the result. If NULL the result contains BOTH removed and non-removed nodes. (defaults to FALSE)
return array<\Neos\ContentRepository\Domain\Model\NodeData>

findByParentWithoutReduce() public method

Only used internally for setting the path of all child nodes
public findByParentWithoutReduce ( string $parentPath, Workspace $workspace ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$parentPath string
$workspace Neos\ContentRepository\Domain\Model\Workspace
return array<\Neos\ContentRepository\Domain\Model\NodeData>

findByPathWithoutReduce() public method

Internal method, used by Node::setPath
public findByPathWithoutReduce ( string $path, Workspace $workspace, boolean $includeRemovedNodes = false, boolean $recursive = false ) : array
$path string
$workspace Neos\ContentRepository\Domain\Model\Workspace
$includeRemovedNodes boolean Should removed nodes be included in the result (defaults to FALSE)
$recursive boolean
return array

findByProperties() public method

This method is internal and will be replaced with better search capabilities.
public findByProperties ( string | array $term, string $nodeTypeFilter, Workspace $workspace, array $dimensions, string $pathStartingPoint = null ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$term string | array Search term
$nodeTypeFilter string Node type filter
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dimensions array
$pathStartingPoint string
return array<\Neos\ContentRepository\Domain\Model\NodeData>

findByWorkspace() public method

Shadow nodes are excluded, because they will be published when publishing the moved node.
public findByWorkspace ( Workspace $workspace ) : array
$workspace Neos\ContentRepository\Domain\Model\Workspace
return array

findFirstByParentAndNodeType() public method

Finds a single node by its parent and (optionally) by its node type
public findFirstByParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions, boolean $removedNodes = false ) : NodeData
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array
$removedNodes boolean If TRUE the result has ONLY removed nodes. If FALSE removed nodes are NOT inside the result. If NULL the result contains BOTH removed and non-removed nodes. (defaults to FALSE)
return Neos\ContentRepository\Domain\Model\NodeData The node found or NULL

findFirstByParentAndNodeTypeInContext() public method

Finds a single node by its parent and (optionally) by its node type
public findFirstByParentAndNodeTypeInContext ( string $parentPath, string $nodeTypeFilter, Context $context ) : NodeData
$parentPath string Absolute path of the parent node
$nodeTypeFilter string Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
$context Neos\ContentRepository\Domain\Service\Context The containing context
return Neos\ContentRepository\Domain\Model\NodeData The node found or NULL

findNextFreeIndexInParentPath() protected method

Finds the next free index on the level below the given parent path across all workspaces.
protected findNextFreeIndexInParentPath ( string $parentPath ) : integer
$parentPath string Path of the parent node specifying the level in the node tree
return integer The next available index

findNextHigherIndex() protected method

The result is determined workspace-agnostic.
protected findNextHigherIndex ( string $parentPath, integer $referenceIndex ) : integer
$parentPath string Path of the parent node specifying the level in the node tree
$referenceIndex integer Index of a known node
return integer The currently next higher index or NULL if no node with a higher index exists

findNextLowerIndex() protected method

The result is determined workspace-agnostic.
protected findNextLowerIndex ( string $parentPath, integer $referenceIndex ) : integer
$parentPath string Path of the parent node specifying the level in the node tree
$referenceIndex integer Index of a known node
return integer The currently next lower index

findNodesByRelatedEntities() public method

Will return all possible NodeData objects that contain this identifiers. Note: This is an internal method that is likely to be replaced in the future. $objectTypeMap = array( 'Neos\Media\Domain\Model\Asset' => array('some-uuid-here'), 'Neos\Media\Domain\Model\ImageVariant' => array('some-uuid-here', 'another-uuid-here') )
public findNodesByRelatedEntities ( array $relationMap ) : array
$relationMap array
return array

findOnPath() public method

If some node does not exist in the specified workspace, this function will try to find a corresponding node in one of the base workspaces (if any).
public findOnPath ( string $pathStartingPoint, string $pathEndPoint, Workspace $workspace, array $dimensions = null, boolean $includeRemovedNodes = false, string $nodeTypeFilter = null ) : array<\Neos\ContentRepository\Domain\Model\NodeData>
$pathStartingPoint string Absolute path specifying the starting point
$pathEndPoint string Absolute path specifying the end point
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array Array of dimensions to array of dimension values
$includeRemovedNodes boolean Should removed nodes be included in the result (defaults to FALSE)
$nodeTypeFilter string Optional filter for the node type of the nodes, supports complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)
return array<\Neos\ContentRepository\Domain\Model\NodeData>

findOneByIdentifier() public method

If the node does not exist in the specified workspace, this function will try to find one with the given identifier in one of the base workspaces (if any).
public findOneByIdentifier ( string $identifier, Workspace $workspace, array $dimensions = null ) : NodeData
$identifier string Identifier of the node
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array An array of dimensions with array of ordered values to use for fallback matching
return Neos\ContentRepository\Domain\Model\NodeData The matching node if found, otherwise NULL

findOneByPath() public method

Find a single node by exact path.
public findOneByPath ( string $path, Workspace $workspace, array $dimensions = null, boolean | null $removedNodes = false ) : NodeData
$path string Absolute path of the node
$workspace Neos\ContentRepository\Domain\Model\Workspace The containing workspace
$dimensions array An array of dimensions with array of ordered values to use for fallback matching
$removedNodes boolean | null Include removed nodes, NULL (all), FALSE (no removed nodes) or TRUE (only removed nodes)
return Neos\ContentRepository\Domain\Model\NodeData The matching node if found, otherwise NULL

findOneByPathInContext() public method

If the node does not exist in the specified context's workspace, this function will try to find one with the given path in one of the base workspaces (if any). Examples for valid paths: the root node foo node "foo" on the first level foo/bar node "bar" on the second level foo/ first node on second level, below "foo"
public findOneByPathInContext ( string $path, Context $context ) : Neos\ContentRepository\Domain\Model\NodeInterface | null
$path string Absolute path of the node
$context Neos\ContentRepository\Domain\Service\Context The containing context
return Neos\ContentRepository\Domain\Model\NodeInterface | null The matching node if found, otherwise NULL

findRawNodesByPath() protected method

To get a "usable" set of nodes, filtering by workspaces, dimensions and removed nodes must be done on the result.
protected findRawNodesByPath ( string $path, Workspace $workspace, array $dimensions = null, boolean $onlyShadowNodes = false ) : array
$path string
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dimensions array
$onlyShadowNodes boolean
return array

findShadowNodeByPath() public method

Find a shadow node by exact path
public findShadowNodeByPath ( string $path, Workspace $workspace, array $dimensions = null ) : NodeData | null
$path string
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dimensions array
return Neos\ContentRepository\Domain\Model\NodeData | null

flushNodeRegistry() public method

This method is (and should only be) used as a slot to the allObjectsPersisted signal.
public flushNodeRegistry ( ) : void
return void

getNodeDataForParentAndNodeType() protected method

Internal method
protected getNodeDataForParentAndNodeType ( string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, boolean | null $removedNodes = false, boolean $recursive = false ) : array
$parentPath string
$nodeTypeFilter string
$workspace Neos\ContentRepository\Domain\Model\Workspace
$dimensions array
$removedNodes boolean | null
$recursive boolean
return array

getNodeTypeFilterConstraints() protected method

protected getNodeTypeFilterConstraints ( Neos\Flow\Persistence\QueryInterface $query, $nodeTypeFilter ) : array
$query Neos\Flow\Persistence\QueryInterface
$nodeTypeFilter
return array

getNodeTypeFilterConstraintsForDql() protected method

Both are numeric arrays with the respective node types that are included or excluded.
protected getNodeTypeFilterConstraintsForDql ( string $nodeTypeFilter ) : array
$nodeTypeFilter string
return array

isInRemovedNodes() public method

Test if a given NodeData is in the set of removed node data objects
public isInRemovedNodes ( NodeData $nodeData ) : boolean
$nodeData Neos\ContentRepository\Domain\Model\NodeData
return boolean TRUE If the NodeData was marked for removal

openIndexSpace() protected method

All indices that are greater or equal to the given referenceIndex are incremented by 100
protected openIndexSpace ( string $parentPath, integer $referenceIndex )
$parentPath string
$referenceIndex integer

pathExists() public method

Find out if the given path exists anywhere in the CR. (internal) If you need this functionality use \Neos\ContentRepository\Domain\Service\NodeService::nodePathExistsInAnyContext()
public pathExists ( string $nodePath ) : boolean
$nodePath string
return boolean

persistEntities() public method

Persists all entities managed by the repository and all cascading dependencies
public persistEntities ( ) : void
return void

reduceNodeVariantsByWorkspaces() protected method

Given an array with duplicate nodes (from different workspaces) those are reduced to uniqueness (by node identifier and dimensions hash)
protected reduceNodeVariantsByWorkspaces ( array $nodes, array $workspaces ) : array
$nodes array NodeData
$workspaces array
return array Array of unique node results indexed by identifier and dimensions hash

reduceNodeVariantsByWorkspacesAndDimensions() protected method

Given an array with duplicate nodes (from different workspaces and dimensions) those are reduced to uniqueness (by node identifier)
protected reduceNodeVariantsByWorkspacesAndDimensions ( array $nodes, array $workspaces, array $dimensions ) : array
$nodes array NodeData result with multiple and duplicate identifiers (different nodes and redundant results for node variants with different dimensions)
$workspaces array
$dimensions array
return array Array of unique node results indexed by identifier

remove() public method

This repository keeps track of added and removed nodes (additionally to the other Unit of Work) in order to find in-memory nodes.
public remove ( object $object ) : void
$object object The object to remove
return void

removeAllInPath() public method

Remove all nodes below a given path. Does not care about workspaces and dimensions.
public removeAllInPath ( string $path ) : void
$path string Starting point path underneath all nodes are to be removed.
return void

reset() public method

Reset instances (internal).
See also: flushNodeRegistry()
Deprecation: Use flushNodeRegistry()
public reset ( ) : void
return void

setHighestIndexInParentPath() protected method

protected setHighestIndexInParentPath ( string $parentPath, integer $highestIndex ) : void
$parentPath string
$highestIndex integer
return void

setNewIndex() public method

If the position is "before" or "after", an index will be chosen which makes the given node the previous or next node of the given reference node. If the position "last" is specified, an index higher than any existing index will be chosen. If no free index is available between two nodes (for "before" and "after"), the whole index of the current node level will be renumbered.
public setNewIndex ( NodeData $node, integer $position, Neos\ContentRepository\Domain\Model\NodeInterface $referenceNode = null ) : void
$node Neos\ContentRepository\Domain\Model\NodeData The node to set the new index for
$position integer The position the new index should reflect, must be one of the POSITION_* constants
$referenceNode Neos\ContentRepository\Domain\Model\NodeInterface The reference node. Mandatory for POSITION_BEFORE and POSITION_AFTER
return void

sortNodesByIndex() protected method

Sorts the given nodes by their index
protected sortNodesByIndex ( array $nodes ) : array
$nodes array Nodes
return array Nodes sorted by index

Property Details

$addedNodes protected_oe property

protected SplObjectStorage $addedNodes
return SplObjectStorage

$defaultOrderings protected_oe property

protected array $defaultOrderings
return array

$entityManager protected_oe property

..
protected ObjectManager,Doctrine\Common\Persistence $entityManager
return Doctrine\Common\Persistence\ObjectManager

$highestIndexCache protected_oe property

protected array $highestIndexCache
return array

$nodeFactory protected_oe property

protected NodeFactory,Neos\ContentRepository\Domain\Factory $nodeFactory
return Neos\ContentRepository\Domain\Factory\NodeFactory

$nodeTypeManager protected_oe property

protected NodeTypeManager,Neos\ContentRepository\Domain\Service $nodeTypeManager
return Neos\ContentRepository\Domain\Service\NodeTypeManager

$removedNodes protected_oe property

protected SplObjectStorage $removedNodes
return SplObjectStorage

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
return Neos\Flow\Security\Context

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface