-
-
Notifications
You must be signed in to change notification settings - Fork 223
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEATURE: Add ContentSubgraphInterface::findClosestNode()
#4519
Conversation
Hi, just a though, what about naming it Then this would be an actual 1 to 1 drop in for $documentNode = $subgraph->findClosestNode($node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: 'Neos.Neos:Document'); |
..that returns the entry node itself, if it matches the filter
@mhsdesign that's a very good point, that makes the query much more useful. Adjusted with cddc41d |
Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php
Outdated
Show resolved
Hide resolved
…ntentSubgraphInterface.php Co-authored-by: Marc Henry Schultz <[email protected]>
before merging this i would like to discuss how we want to ideally fetch all the necessary nodes for the fusion view. Based on an entryNode, we need So the document node can be found via this PR I had the idea to combine both lookups into one query: $ancestors = $subgraph->findAncestorNodes($node->nodeAggregateId, FindAncestorNodesFilter::create(nodeTypeConstraints: 'Neos.Neos:Document');
$documentNode = $node->nodeType->isOfType('Neos.Neos:Document') ? $node : $ancestors->first();
$siteNode = $ancestors->last(); but i dont know if its a criteria for the homepage node to be of type Neos.Neos:Document? see https://neos-project.slack.com/archives/C3MCBK6S2/p1694339628529459?thread_ts=1694269188.257739&channel=C3MCBK6S2&message_ts=1694339628.529459 the other approach using your neos-development-collection/Neos.Neos/Classes/Domain/Service/SiteNodeUtility.php Lines 40 to 57 in d9c374a
$documentNode = $subgraph->findClosestNode($node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: 'Neos.Neos:Document');
$siteNode = $this->siteNodeUtility->findSiteNode($node); i just remembered that Bernhard hat the plan to introduce a this would allow to write a querys like: $documentNode = $subgraph->findClosestNode($node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: 'Neos.Neos:Document');
$siteNode = $subgraph->findClosestNode($node->nodeAggregateId, FindClosestNodeFilter::create(nodeTypeConstraints: 'Neos.Neos:Site'); which is imo as perfect as it gets? |
ContentSubgraphInterface::findClosestAncestorNode()
ContentSubgraphInterface::findClosestNode()
is that really related to this very PR?
Why is that hacky? |
Hey, looked at the code, looks great to me. @bwaidelich IMHO this can be merged. Great work :) @mhsdesign I do not understand why you want to open up the use cases even more; IMHO these are separate topics. All the best, |
yes no sorry all fine - that was just the thinking progress in my head ^^ i really like this and lets merge it! |
Resolves: #4517