class NodeDataRepository extends Repository (View source)

A purely internal repository for NodeData storage

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.

Constants

POSITION_BEFORE

Constants for setNewIndex()

POSITION_AFTER

POSITION_LAST

INDEX_MAXIMUM

Maximum possible index

Properties

protected SplObjectStorage $addedNodes
protected SplObjectStorage $removedNodes
protected EntityManagerInterface $entityManager

Doctrine's Entity Manager.

protected NodeTypeManager $nodeTypeManager
protected LoggerInterface $systemLogger
protected NodeFactory $nodeFactory
protected Context $securityContext
protected array $highestIndexCache
protected array $defaultOrderings

Methods

__construct()

Constructor

void
add(object $object)

Adds a NodeData object to this repository.

void
remove(object $object)

Removes an object to the persistence.

findByNodeIdentifier($nodeIdentifier)

No description

findOneByPath(string $path, Workspace $workspace, array $dimensions = null, bool|null $removedNodes = false)

Find a single node by exact path.

NodeData|null
findShadowNodeByPath(string $path, Workspace $workspace, array $dimensions = null)

Find a shadow node by exact path

array
findRawNodesByPath(string $path, Workspace $workspace, array $dimensions = null, bool $onlyShadowNodes = false)

This finds nodes by path and delivers a raw, unfiltered result.

findOneByPathInContext(string $path, Context $context)

Finds a node by its path and context.

findOneByIdentifier(string $identifier, Workspace $workspace, array $dimensions = null, bool $removedNodes = false)

Finds a node by its identifier and workspace.

IterableResult
findAllIterator()

Find all objects and return an IterableResult

iterate(IterableResult $iterator, callable $callback = null)

Iterate over an IterableResult and return a Generator

void
setNewIndex(NodeData $node, int $position, NodeInterface $referenceNode = null)

Assigns an index to the given node which reflects the specified position.

findByParentAndNodeTypeRecursively(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool $removedNodes = false)

Finds recursively nodes by its parent and (optionally) by its node type.

findByParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool $removedNodes = false, bool $recursive = false)

Finds nodes by its parent and (optionally) by its node type.

array
getNodeDataForParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool|null $removedNodes = false, bool $recursive = false)

Internal method

findByParentWithoutReduce(string $parentPath, Workspace $workspace)

Find NodeData by parent path without any dimension reduction and grouping by identifier

findByIdentifierWithoutReduce(string $identifier, Workspace $workspace)

Find NodeData by identifier path without any dimension reduction

findByParentAndNodeTypeInContext(string $parentPath, string $nodeTypeFilter, Context $context, bool $recursive = false)

Finds nodes by its parent and (optionally) by its node type given a Context

int
countByParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool $includeRemovedNodes = false)

Counts nodes by its parent and (optionally) by its node type.

openIndexSpace(string $parentPath, int $referenceIndex)

Make room in the sortindex-index space of a given path in preparation to inserting a node.

int
findNextFreeIndexInParentPath(string $parentPath)

Finds the next free index on the level below the given parent path across all workspaces.

void
setHighestIndexInParentPath(string $parentPath, int $highestIndex)

No description

int
findNextLowerIndex(string $parentPath, int $referenceIndex)

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.

int
findNextHigherIndex(string $parentPath, int $referenceIndex)

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.

int
countByWorkspace(Workspace $workspace)

Counts the number of nodes within the specified workspace

array
sortNodesByIndex(array $nodes)

Sorts the given nodes by their index

findFirstByParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions, bool $removedNodes = false)

Finds a single node by its parent and (optionally) by its node type

findFirstByParentAndNodeTypeInContext(string $parentPath, string $nodeTypeFilter, Context $context)

Finds a single node by its parent and (optionally) by its node type

findOnPath(string $pathStartingPoint, string $pathEndPoint, Workspace $workspace, array $dimensions = null, bool $includeRemovedNodes = false, string $nodeTypeFilter = null)

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.

findByProperties(string|array $term, string $nodeTypeFilter, Workspace $workspace, array $dimensions, string $pathStartingPoint = null)

Find nodes by a value in properties

void
flushNodeRegistry()

Flushes the addedNodes and removedNodes registry.

void
addNodeTypeFilterConstraintsToQueryBuilder(QueryBuilder $queryBuilder, string $nodeTypeFilter)

Add node type filter constraints to the query builder

array
getNodeTypeFilterConstraintsForDql(string|null $nodeTypeFilter = '')

Generates a two dimensional array with the filters. First level is: 'excludeNodeTypes' 'includeNodeTypes'

array
getNodeTypeFilterConstraints(QueryInterface $query, $nodeTypeFilter)

No description

void
filterOutRemovedObjects(array $objects)

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.

array
withoutRemovedNodes(array $nodes)

Returns a subset of $nodes which are not flagged as removed.

array
onlyRemovedNodes(array $nodes)

Returns a subset of $nodes which are flagged as removed.

void
persistEntities()

Persists all entities managed by the repository and all cascading dependencies

void
emitRepositoryObjectsPersisted()

Signals that persistEntities() in this repository finished correctly.

void
addDimensionJoinConstraintsToQueryBuilder(QueryBuilder $queryBuilder, array $dimensions)

If $dimensions is not empty, adds join constraints to the given $queryBuilder limiting the query result to matching hits.

array
reduceNodeVariantsByWorkspacesAndDimensions(array $nodes, array $workspaces, array $dimensions)

Given an array with duplicate nodes (from different workspaces and dimensions) those are reduced to uniqueness (by node identifier)

array
reduceNodeVariantsByWorkspaces(array $nodes, array $workspaces)

Given an array with duplicate nodes (from different workspaces) those are reduced to uniqueness (by node identifier and dimensions hash)

findByWorkspace(Workspace $workspace)

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.

bool
pathExists(string $nodePath)

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

findByPathWithoutReduce(string $path, Workspace $workspace, bool $includeRemovedNodes = false, bool $recursive = false)

Find all node data in a path matching the given workspace hierarchy

array
findNodesByRelatedEntities(array $relationMap)

Searches for possible relations to the given entity identifiers in NodeData.

array
findNodesByPathPrefixAndRelatedEntities(string $pathPrefix, array $relationMap)

Searches for possible relations to the given entity identifiers in NodeData using a path prefix.

void
removeAllInPath(string $path)

Remove all nodes below a given path. Does not care about workspaces and dimensions.

bool
isInRemovedNodes(NodeData $nodeData)

Test if a given NodeData is in the set of removed node data objects

QueryBuilder
createQueryBuilder(array $workspaces)

No description

void
addParentPathConstraintToQueryBuilder(QueryBuilder $queryBuilder, string $parentPath, bool $recursive = false)

No description

void
addPathConstraintToQueryBuilder(QueryBuilder $queryBuilder, string $path, bool $recursive = false)

No description

void
addIdentifierConstraintToQueryBuilder(QueryBuilder $queryBuilder, string $identifier)

No description

array
filterNodeDataByBestMatchInContext(array $nodeDataObjects, Workspace $workspace, array $dimensions, bool $includeRemovedNodes = false)

No description

array
collectWorkspaceAndAllBaseWorkspaces(Workspace $workspace)

Returns an array that contains the given workspace and all base (parent) workspaces of it.

QueryBuilder
buildQueryBuilderForRelationMap(array $relationMap)

Returns a query builder for a query on node data using the given relation map.

Details

__construct()

Constructor

void add(object $object)

Adds a NodeData object to this repository.

This repository keeps track of added and removed nodes (additionally to the other Unit of Work) in order to find in-memory nodes.

Parameters

object $object

The object to add

Return Value

void

void remove(object $object)

Removes an object to the persistence.

This repository keeps track of added and removed nodes (additionally to the other Unit of Work) in order to find in-memory nodes.

Parameters

object $object

The object to remove

Return Value

void

findByNodeIdentifier($nodeIdentifier)

No description

Parameters

$nodeIdentifier

NodeData findOneByPath(string $path, Workspace $workspace, array $dimensions = null, bool|null $removedNodes = false)

Find a single node by exact path.

Parameters

string $path

Absolute path of the node

Workspace $workspace

The containing workspace

array $dimensions

An array of dimensions with array of ordered values to use for fallback matching

bool|null $removedNodes

Include removed nodes, NULL (all), false (no removed nodes) or true (only removed nodes)

Return Value

NodeData

The matching node if found, otherwise NULL

Exceptions

InvalidArgumentException

NodeData|null findShadowNodeByPath(string $path, Workspace $workspace, array $dimensions = null)

Find a shadow node by exact path

Parameters

string $path
Workspace $workspace
array $dimensions

Return Value

NodeData|null

protected array findRawNodesByPath(string $path, Workspace $workspace, array $dimensions = null, bool $onlyShadowNodes = false)

This finds nodes by path and delivers a raw, unfiltered result.

To get a "usable" set of nodes, filtering by workspaces, dimensions and removed nodes must be done on the result.

Parameters

string $path
Workspace $workspace
array $dimensions
bool $onlyShadowNodes

Return Value

array

Exceptions

InvalidArgumentException

NodeInterface|null findOneByPathInContext(string $path, Context $context)

Finds a node by its path and context.

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"

Parameters

string $path

Absolute path of the node

Context $context

The containing context

Return Value

NodeInterface|null

The matching node if found, otherwise NULL

Exceptions

InvalidArgumentException

NodeData findOneByIdentifier(string $identifier, Workspace $workspace, array $dimensions = null, bool $removedNodes = false)

Finds a node by its identifier and workspace.

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).

Parameters

string $identifier

Identifier of the node

Workspace $workspace

The containing workspace

array $dimensions

An array of dimensions with array of ordered values to use for fallback matching

bool $removedNodes

If shadow nodes should be considered while finding the specified node

Return Value

NodeData

The matching node if found, otherwise NULL

IterableResult findAllIterator()

Find all objects and return an IterableResult

Return Value

IterableResult

Generator iterate(IterableResult $iterator, callable $callback = null)

Iterate over an IterableResult and return a Generator

This method is useful for batch processing a huge result set.

Parameters

IterableResult $iterator
callable $callback

Return Value

Generator

void setNewIndex(NodeData $node, int $position, NodeInterface $referenceNode = null)

Assigns an index to the given node which reflects the specified position.

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.

Parameters

NodeData $node

The node to set the new index for

int $position

The position the new index should reflect, must be one of the POSITION_* constants

NodeInterface $referenceNode

The reference node. Mandatory for POSITION_BEFORE and POSITION_AFTER

Return Value

void

Exceptions

InvalidArgumentException

NodeData[] findByParentAndNodeTypeRecursively(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool $removedNodes = false)

Finds recursively nodes by its parent and (optionally) by its node type.

Parameters

string $parentPath

Absolute path of the parent node

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)

Workspace $workspace

The containing workspace

array $dimensions

An array of dimensions to dimension values

bool $removedNodes

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 Value

NodeData[]

The nodes found on the given path

See also

findByParentAndNodeType()

NodeData[] findByParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool $removedNodes = false, bool $recursive = false)

Finds nodes by its parent and (optionally) by its node type.

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.

Improve implementation by using DQL

Parameters

string $parentPath

Absolute path of the parent node

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)

Workspace $workspace

The containing workspace

array $dimensions

An array of dimensions to dimension values

bool $removedNodes

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)

bool $recursive

If true all matching nodes underneath the specified parent path are returned

Return Value

NodeData[]

The nodes found on the given path

protected array getNodeDataForParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool|null $removedNodes = false, bool $recursive = false)

Internal method

Parameters

string $parentPath
string $nodeTypeFilter
Workspace $workspace
array $dimensions
bool|null $removedNodes
bool $recursive

Return Value

array

NodeData[] findByParentWithoutReduce(string $parentPath, Workspace $workspace)

Find NodeData by parent path without any dimension reduction and grouping by identifier

Only used internally for setting the path of all child nodes

Parameters

string $parentPath
Workspace $workspace

Return Value

NodeData[]

A unreduced array of NodeData

NodeData[] findByIdentifierWithoutReduce(string $identifier, Workspace $workspace)

Find NodeData by identifier path without any dimension reduction

Only used internally for finding whether the node exists in another dimension

Parameters

string $identifier
Workspace $workspace

Return Value

NodeData[]

A unreduced array of NodeData

NodeInterface[] findByParentAndNodeTypeInContext(string $parentPath, string $nodeTypeFilter, Context $context, bool $recursive = false)

Finds nodes by its parent and (optionally) by its node type given a Context

TODO Move to a new Node operation getDescendantNodes(...)

Parameters

string $parentPath

Absolute path of the parent node

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)

Context $context

The containing workspace

bool $recursive

If true all matching nodes underneath the specified parent path are returned

Return Value

NodeInterface[]

The nodes found on the given path

int countByParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions = null, bool $includeRemovedNodes = false)

Counts nodes by its parent and (optionally) by its node type.

NOTE: Only considers persisted nodes!

Parameters

string $parentPath

Absolute path of the parent node

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)

Workspace $workspace

The containing workspace

array $dimensions
bool $includeRemovedNodes

Should removed nodes be included in the result (defaults to false)

Return Value

int

The number of nodes a similar call to findByParentAndNodeType() would return without any pending added nodes

protected openIndexSpace(string $parentPath, int $referenceIndex)

Make room in the sortindex-index space of a given path in preparation to inserting a node.

All indices that are greater or equal to the given referenceIndex are incremented by 100

Parameters

string $parentPath
int $referenceIndex

Exceptions

NodeException

protected int findNextFreeIndexInParentPath(string $parentPath)

Finds the next free index on the level below the given parent path across all workspaces.

Parameters

string $parentPath

Path of the parent node specifying the level in the node tree

Return Value

int

The next available index

protected void setHighestIndexInParentPath(string $parentPath, int $highestIndex)

No description

Parameters

string $parentPath
int $highestIndex

Return Value

void

protected int findNextLowerIndex(string $parentPath, int $referenceIndex)

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.

The result is determined workspace-agnostic.

Parameters

string $parentPath

Path of the parent node specifying the level in the node tree

int $referenceIndex

Index of a known node

Return Value

int

The currently next lower index

protected int findNextHigherIndex(string $parentPath, int $referenceIndex)

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.

The result is determined workspace-agnostic.

Parameters

string $parentPath

Path of the parent node specifying the level in the node tree

int $referenceIndex

Index of a known node

Return Value

int

The currently next higher index or NULL if no node with a higher index exists

int countByWorkspace(Workspace $workspace)

Counts the number of nodes within the specified workspace

Note: Also counts removed nodes

Parameters

Workspace $workspace

The containing workspace

Return Value

int

The number of nodes found

protected array sortNodesByIndex(array $nodes)

Sorts the given nodes by their index

Parameters

array $nodes Nodes

Return Value

array

Nodes sorted by index

NodeData findFirstByParentAndNodeType(string $parentPath, string $nodeTypeFilter, Workspace $workspace, array $dimensions, bool $removedNodes = false)

Finds a single node by its parent and (optionally) by its node type

Parameters

string $parentPath

Absolute path of the parent node

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)

Workspace $workspace

The containing workspace

array $dimensions
bool $removedNodes

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 Value

NodeData

The node found or NULL

NodeInterface findFirstByParentAndNodeTypeInContext(string $parentPath, string $nodeTypeFilter, Context $context)

Finds a single node by its parent and (optionally) by its node type

Parameters

string $parentPath

Absolute path of the parent node

string $nodeTypeFilter

Filter the node type of the nodes, allows complex expressions (e.g. "Neos.Neos:Page", "!Neos.Neos:Page,Neos.Neos:Text" or NULL)

Context $context

The containing context

Return Value

NodeInterface

The node found or NULL

NodeData[] findOnPath(string $pathStartingPoint, string $pathEndPoint, Workspace $workspace, array $dimensions = null, bool $includeRemovedNodes = false, string $nodeTypeFilter = null)

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.

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).

findOnPath should probably not return child nodes of removed nodes unless removed nodes are included.

Parameters

string $pathStartingPoint

Absolute path specifying the starting point

string $pathEndPoint

Absolute path specifying the end point

Workspace $workspace

The containing workspace

array $dimensions

Array of dimensions to array of dimension values

bool $includeRemovedNodes

Should removed nodes be included in the result (defaults to false)

string $nodeTypeFilter

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 Value

NodeData[]

The nodes found on the given path

Exceptions

InvalidArgumentException

NodeData[] findByProperties(string|array $term, string $nodeTypeFilter, Workspace $workspace, array $dimensions, string $pathStartingPoint = null)

Find nodes by a value in properties

This method is internal and will be replaced with better search capabilities.

Parameters

string|array $term

Search term

string $nodeTypeFilter

Node type filter

Workspace $workspace
array $dimensions
string $pathStartingPoint

Return Value

NodeData[]

void flushNodeRegistry()

Flushes the addedNodes and removedNodes registry.

This method is (and should only be) used as a slot to the allObjectsPersisted signal.

Return Value

void

void addNodeTypeFilterConstraintsToQueryBuilder(QueryBuilder $queryBuilder, string $nodeTypeFilter)

Add node type filter constraints to the query builder

Parameters

QueryBuilder $queryBuilder
string $nodeTypeFilter

Return Value

void

protected array getNodeTypeFilterConstraintsForDql(string|null $nodeTypeFilter = '')

Generates a two dimensional array with the filters. First level is: 'excludeNodeTypes' 'includeNodeTypes'

Both are numeric arrays with the respective node types that are included or excluded.

Parameters

string|null $nodeTypeFilter

Return Value

array

protected array getNodeTypeFilterConstraints(QueryInterface $query, $nodeTypeFilter)

No description

Parameters

QueryInterface $query
$nodeTypeFilter

Return Value

array

protected void filterOutRemovedObjects(array $objects)

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.

Technically this is a check of the given array against $this->removedNodes.

Parameters

array $objects

An array of objects to filter, passed by reference.

Return Value

void

protected array withoutRemovedNodes(array $nodes)

Returns a subset of $nodes which are not flagged as removed.

Parameters

array $nodes

NodeData including removed entries

Return Value

array

Only those NodeData instances which are not flagged as removed

protected array onlyRemovedNodes(array $nodes)

Returns a subset of $nodes which are flagged as removed.

Parameters

array $nodes

NodeData including removed entries

Return Value

array

Only those NodeData instances which are flagged as removed

void persistEntities()

Persists all entities managed by the repository and all cascading dependencies

Return Value

void

protected void emitRepositoryObjectsPersisted()

Signals that persistEntities() in this repository finished correctly.

Return Value

void

protected void addDimensionJoinConstraintsToQueryBuilder(QueryBuilder $queryBuilder, array $dimensions)

If $dimensions is not empty, adds join constraints to the given $queryBuilder limiting the query result to matching hits.

Parameters

QueryBuilder $queryBuilder
array $dimensions

Return Value

void

protected array reduceNodeVariantsByWorkspacesAndDimensions(array $nodes, array $workspaces, array $dimensions)

Given an array with duplicate nodes (from different workspaces and dimensions) those are reduced to uniqueness (by node identifier)

Parameters

array $nodes

NodeData result with multiple and duplicate identifiers (different nodes and redundant results for node variants with different dimensions)

array $workspaces
array $dimensions

Return Value

array

Array of unique node results indexed by identifier

Exceptions

NodeException

protected array reduceNodeVariantsByWorkspaces(array $nodes, array $workspaces)

Given an array with duplicate nodes (from different workspaces) those are reduced to uniqueness (by node identifier and dimensions hash)

Parameters

array $nodes NodeData
array $workspaces

Return Value

array

Array of unique node results indexed by identifier and dimensions hash

NodeData[] findByWorkspace(Workspace $workspace)

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.

Shadow nodes are excluded, because they will be published when publishing the moved node.

Parameters

Workspace $workspace

Return Value

NodeData[]

bool pathExists(string $nodePath)

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

Parameters

string $nodePath

Return Value

bool

NodeData[] findByPathWithoutReduce(string $path, Workspace $workspace, bool $includeRemovedNodes = false, bool $recursive = false)

Find all node data in a path matching the given workspace hierarchy

Internal method, used by Node::setPath

Parameters

string $path
Workspace $workspace
bool $includeRemovedNodes

Should removed nodes be included in the result (defaults to false)

bool $recursive

Return Value

NodeData[]

Node data reduced by workspace but with all existing content dimension variants, includes removed nodes

array findNodesByRelatedEntities(array $relationMap)

Searches for possible relations to the given entity identifiers in NodeData.

Will return all possible NodeData objects that contain this identifiers. See buildQueryBuilderForRelationMap for the relationMap definition.

Note: This is an internal method that is likely to be replaced in the future.

Parameters

array $relationMap

Return Value

array

array findNodesByPathPrefixAndRelatedEntities(string $pathPrefix, array $relationMap)

Searches for possible relations to the given entity identifiers in NodeData using a path prefix.

Will return all possible NodeData objects that contain this identifiers. See buildQueryBuilderForRelationMap for the relationMap definition.

Note: This is an internal method that is likely to be replaced in the future.

Parameters

string $pathPrefix
array $relationMap

Return Value

array

void removeAllInPath(string $path)

Remove all nodes below a given path. Does not care about workspaces and dimensions.

Parameters

string $path

Starting point path underneath all nodes are to be removed.

Return Value

void

bool isInRemovedNodes(NodeData $nodeData)

Test if a given NodeData is in the set of removed node data objects

Parameters

NodeData $nodeData

Return Value

bool

true If the NodeData was marked for removal

protected QueryBuilder createQueryBuilder(array $workspaces)

No description

Parameters

array $workspaces

Return Value

QueryBuilder

protected void addParentPathConstraintToQueryBuilder(QueryBuilder $queryBuilder, string $parentPath, bool $recursive = false)

No description

Parameters

QueryBuilder $queryBuilder
string $parentPath
bool $recursive

Return Value

void

protected void addPathConstraintToQueryBuilder(QueryBuilder $queryBuilder, string $path, bool $recursive = false)

No description

Parameters

QueryBuilder $queryBuilder
string $path
bool $recursive

Return Value

void

protected void addIdentifierConstraintToQueryBuilder(QueryBuilder $queryBuilder, string $identifier)

No description

Parameters

QueryBuilder $queryBuilder
string $identifier

Return Value

void

protected array filterNodeDataByBestMatchInContext(array $nodeDataObjects, Workspace $workspace, array $dimensions, bool $includeRemovedNodes = false)

No description

Parameters

array $nodeDataObjects
Workspace $workspace
array $dimensions
bool $includeRemovedNodes

Should removed nodes be included in the result (defaults to false)

Return Value

array

protected array collectWorkspaceAndAllBaseWorkspaces(Workspace $workspace)

Returns an array that contains the given workspace and all base (parent) workspaces of it.

Parameters

Workspace $workspace

Return Value

array

protected QueryBuilder buildQueryBuilderForRelationMap(array $relationMap)

Returns a query builder for a query on node data using the given relation map.

$objectTypeMap = [ 'Neos\Media\Domain\Model\Asset' => ['some-uuid-here'], 'Neos\Media\Domain\Model\ImageVariant' => ['some-uuid-here', 'another-uuid-here'] ]

Parameters

array $relationMap

Return Value

QueryBuilder