Open mhsdesign opened 4 months ago
The Neos ui currently holds such logic
protected function isNodeTypeAllowedAsChildNode(Node $parentNode, NodeTypeName $nodeTypeNameToCheck): bool { $nodeTypeManager = $this->contentRepositoryRegistry->get($parentNode->contentRepositoryId)->getNodeTypeManager(); $parentNodeType = $nodeTypeManager->getNodeType($parentNode->nodeTypeName); if (!$parentNodeType) { return false; } if ($parentNode->classification !== NodeAggregateClassification::CLASSIFICATION_TETHERED) { $nodeTypeToCheck = $nodeTypeManager->getNodeType($nodeTypeNameToCheck); if (!$nodeTypeToCheck) { return false; } return $parentNodeType->allowsChildNodeType($nodeTypeToCheck); } $subgraph = $this->contentRepositoryRegistry->subgraphForNode($parentNode); $grandParentNode = $subgraph->findParentNode($parentNode->aggregateId); return !$grandParentNode || $nodeTypeManager->isNodeTypeAllowedAsChildToTetheredNode( $grandParentNode->nodeTypeName, $parentNode->name, $nodeTypeNameToCheck ); }
that was once part of the Node itself via https://github.com/neos/neos-development-collection/blob/eada1dbfb569de6e3932b26b4b3c630401020e05/Neos.ContentRepository/Classes/Domain/Model/Node.php#L1927
Node
That cannot be anymore as we removed the NodeType on the node but there should probably be a utility method?
The Neos ui currently holds such logic
that was once part of the
Node
itself via https://github.com/neos/neos-development-collection/blob/eada1dbfb569de6e3932b26b4b3c630401020e05/Neos.ContentRepository/Classes/Domain/Model/Node.php#L1927That cannot be anymore as we removed the NodeType on the node but there should probably be a utility method?