Skip to content

Commit

Permalink
Merge pull request neos#3625 from neos/task/4522-renameNodeTypeConstr…
Browse files Browse the repository at this point in the history
…aints

TASK: Adjust to renamed `NodeTypeConstraints`
  • Loading branch information
ahaeslich committed Nov 3, 2023
2 parents 5306eea + 8c1b108 commit 4bd6825
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Classes/ContentRepository/Service/WorkspaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getPublishableNodeInfo(WorkspaceName $workspaceName, ContentRepo
$node = $subgraph->findNodeById($change->nodeAggregateId);

if ($node instanceof Node) {
$documentNode = $subgraph->findClosestNode($node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: NodeTypeNameFactory::NAME_DOCUMENT));
$documentNode = $subgraph->findClosestNode($node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT));
if ($documentNode instanceof Node) {
$contentRepository = $this->contentRepositoryRegistry->get($documentNode->subgraphIdentity->contentRepositoryId);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/AbstractChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ protected function updateWorkspaceInfo(): void
{
if (!is_null($this->subject)) {
$subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->subject);
$documentNode = $subgraph->findClosestNode($this->subject->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: NodeTypeNameFactory::NAME_DOCUMENT));
$documentNode = $subgraph->findClosestNode($this->subject->nodeAggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT));
if (!is_null($documentNode)) {
$contentRepository = $this->contentRepositoryRegistry->get($this->subject->subgraphIdentity->contentRepositoryId);
$workspace = $contentRepository->getWorkspaceFinder()->findOneByCurrentContentStreamId(
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Model/Changes/Remove.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function apply(): void
$this->updateWorkspaceInfo();

$subgraph = $this->contentRepositoryRegistry->subgraphForNode($this->subject);
$closestDocumentParentNode = $subgraph->findClosestNode($this->subject->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: NodeTypeNameFactory::NAME_DOCUMENT));
$closestDocumentParentNode = $subgraph->findClosestNode($this->subject->nodeAggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT));
$command = RemoveNodeAggregate::create(
$subject->subgraphIdentity->contentStreamId,
$subject->nodeAggregateId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function serializePayload(ControllerContext $controllerContext): array
$nodeInfoHelper = new NodeInfoHelper();

$documentNode = $this->contentRepositoryRegistry->subgraphForNode($this->node)
->findClosestNode($this->node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: NodeTypeNameFactory::NAME_DOCUMENT));
->findClosestNode($this->node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT));

if ($documentNode) {
return [
Expand Down
8 changes: 4 additions & 4 deletions Classes/FlowQueryOperations/NeosUiDefaultNodesOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Eel\FlowQuery\FlowQuery;
use Neos\Eel\FlowQuery\Operations\AbstractOperation;
Expand Down Expand Up @@ -75,14 +75,14 @@ public function evaluate(FlowQuery $flowQuery, array $arguments)
$contentRepository = $this->contentRepositoryRegistry->get($documentNode->subgraphIdentity->contentRepositoryId);
$nodeAddressFactory = NodeAddressFactory::create($contentRepository);

$baseNodeTypeConstraints = NodeTypeConstraints::fromFilterString($baseNodeType);
$baseNodeTypeConstraints = NodeTypeCriteria::fromFilterString($baseNodeType);

$subgraph = $this->contentRepositoryRegistry->subgraphForNode($documentNode);

$ancestors = $subgraph->findAncestorNodes(
$documentNode->nodeAggregateId,
FindAncestorNodesFilter::create(
NodeTypeConstraints::fromFilterString('Neos.Neos:Document')
NodeTypeCriteria::fromFilterString('Neos.Neos:Document')
)
);

Expand Down Expand Up @@ -117,7 +117,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments)
) {
foreach ($subgraph->findChildNodes(
$baseNode->nodeAggregateId,
FindChildNodesFilter::create(nodeTypeConstraints: $baseNodeTypeConstraints)
FindChildNodesFilter::create(nodeTypes: $baseNodeTypeConstraints)
) as $childNode) {
$nodes[$childNode->nodeAggregateId->value] = $childNode;
$gatherNodesRecursively($nodes, $childNode, $level + 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter;
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\NodeType\NodeTypeConstraintParser;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Eel\FlowQuery\FlowQuery;
use Neos\Eel\FlowQuery\Operations\AbstractOperation;
Expand Down Expand Up @@ -76,7 +76,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments)

foreach ($subgraph->findChildNodes(
$contextNode->nodeAggregateId,
FindChildNodesFilter::create(nodeTypeConstraints: $arguments[0] ?? null)
FindChildNodesFilter::create(nodeTypes: $arguments[0] ?? null)
) as $childNode) {
if (!isset($outputNodeIdentifiers[$childNode->nodeAggregateId->value])) {
$output[] = $childNode;
Expand Down
4 changes: 2 additions & 2 deletions Classes/FlowQueryOperations/SearchOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use Neos\ContentRepository\Core\Projection\ContentGraph\Node;
use Neos\ContentRepository\Core\Projection\ContentGraph\SearchTerm;
use Neos\ContentRepository\Core\NodeType\NodeTypeConstraintParser;
use Neos\ContentRepository\Core\Projection\ContentGraph\NodeTypeConstraints;
use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria;
use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds;
use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry;
use Neos\Eel\FlowQuery\FlowQuery;
Expand Down Expand Up @@ -80,7 +80,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments): void
$filter = $filter->with(searchTerm: $arguments[0]);
}
if (isset($arguments[1]) && $arguments[1] !== '') {
$filter = $filter->with(nodeTypeConstraints: $arguments[1]);
$filter = $filter->with(nodeTypes: $arguments[1]);
}
$nodes = $subgraph->findDescendantNodes(
$contextNode->nodeAggregateId,
Expand Down
6 changes: 3 additions & 3 deletions Classes/Fusion/Helper/NodeInfoHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,13 +245,13 @@ protected function renderChildrenInformation(Node $node, string $nodeTypeFilterS

$documentChildNodes = $subgraph->findChildNodes(
$node->nodeAggregateId,
FindChildNodesFilter::create(nodeTypeConstraints: $nodeTypeFilterString)
FindChildNodesFilter::create(nodeTypes: $nodeTypeFilterString)
);
// child nodes for content tree, must not include those nodes filtered out by `baseNodeType`
$contentChildNodes = $subgraph->findChildNodes(
$node->nodeAggregateId,
FindChildNodesFilter::create(
nodeTypeConstraints: $this->buildContentChildNodeFilterString()
nodeTypes: $this->buildContentChildNodeFilterString()
)
);
$childNodes = $documentChildNodes->merge($contentChildNodes);
Expand Down Expand Up @@ -480,7 +480,7 @@ private function getChildNodes(Node $node, string $nodeTypeFilterString): Nodes
return $this->contentRepositoryRegistry->subgraphForNode($node)
->findChildNodes(
$node->nodeAggregateId,
FindChildNodesFilter::create(nodeTypeConstraints: $nodeTypeFilterString)
FindChildNodesFilter::create(nodeTypes: $nodeTypeFilterString)
);
}

Expand Down

0 comments on commit 4bd6825

Please sign in to comment.