From 2dbd3a04a89694ce2efaf50f2fcca195740ea953 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Sun, 27 Oct 2024 19:37:40 +0100 Subject: [PATCH] TASK: Task rename alias in ancestor queries `cn` should actually be named `ch` as it's joined as the child hierarchy relation --- .../src/Domain/Repository/ContentGraph.php | 11 ++++++----- .../src/Domain/Repository/ContentSubgraph.php | 5 +++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index 88569fd0773..ca019e17fa7 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -55,6 +55,7 @@ * - cn -> child node * - h -> the hierarchy edge connecting parent and child * - ph -> the hierarchy edge incoming to the parent (sometimes relevant) + * - ch -> the hierarchy edge of the child (sometimes relevant) * - dsp -> dimension space point, resolves hashes to full dimension coordinates * - cdsp -> child dimension space point, same as dsp for child queries * - pdsp -> parent dimension space point, same as dsp for parent queries @@ -199,11 +200,11 @@ public function findAncestorNodeAggregateIds(NodeAggregateId $entryNodeAggregate ->andWhere('c.nodeaggregateid = :entryNodeAggregateId'); $queryBuilderRecursive = $this->createQueryBuilder() - ->select('pn.nodeAggregateId, h.parentnodeanchor') - ->from('ancestry', 'cn') - ->innerJoin('cn', $this->nodeQueryBuilder->tableNames->node(), 'pn', 'pn.relationanchorpoint = cn.parentnodeanchor') - ->innerJoin('pn', $this->nodeQueryBuilder->tableNames->hierarchyRelation(), 'h', 'h.childnodeanchor = pn.relationanchorpoint') - ->where('h.contentstreamid = :contentStreamId'); + ->select('pn.nodeAggregateId, ph.parentnodeanchor') + ->from('ancestry', 'ch') + ->innerJoin('ch', $this->nodeQueryBuilder->tableNames->node(), 'pn', 'pn.relationanchorpoint = ch.parentnodeanchor') + ->innerJoin('pn', $this->nodeQueryBuilder->tableNames->hierarchyRelation(), 'ph', 'ph.childnodeanchor = pn.relationanchorpoint') + ->where('ph.contentstreamid = :contentStreamId'); $queryBuilderCte = $this->createQueryBuilder() ->select('pn.nodeAggregateId') diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 810a095069f..b273c36a402 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -74,6 +74,7 @@ * - cn -> child node * - h -> the hierarchy edge connecting parent and child * - ph -> the hierarchy edge incoming to the parent (sometimes relevant) + * - ch -> the hierarchy edge of the child (sometimes relevant) * * - if more than one node (source-destination) * - sn -> source node @@ -570,8 +571,8 @@ private function buildAncestorNodesQueries(NodeAggregateId $entryNodeAggregateId $queryBuilderRecursive = $this->createQueryBuilder() ->select('pn.*, h.subtreetags, h.parentnodeanchor') - ->from('ancestry', 'cn') - ->innerJoin('cn', $this->nodeQueryBuilder->tableNames->node(), 'pn', 'pn.relationanchorpoint = cn.parentnodeanchor') + ->from('ancestry', 'ch') + ->innerJoin('ch', $this->nodeQueryBuilder->tableNames->node(), 'pn', 'pn.relationanchorpoint = ch.parentnodeanchor') ->innerJoin('pn', $this->nodeQueryBuilder->tableNames->hierarchyRelation(), 'h', 'h.childnodeanchor = pn.relationanchorpoint') ->where('h.contentstreamid = :contentStreamId') ->andWhere('h.dimensionspacepointhash = :dimensionSpacePointHash');