neos-development-collection
neos-development-collection copied to clipboard
9.0 Working with `NodeAggregate` is not easy
Sometimes there is the usecase of having a "global" across dimension identical node, and the closest thing to that is operating on the node aggregate. For example i experimented with replacing the site entity with the node aggregate of the siteNode. This experiment can be found here https://github.com/neos/neos-development-collection/pull/4780.
But this practice doesnt seem to be intentioned and there are multiple stones in ones way on the php api and maybe even deeper in the concept.
I stumbled for example across:
- NodeAggregate does not know it
contentRepositoryId(can be achieved viareturn current($this->nodesByOccupiedDimensionSpacePoint)->subgraphIdentity->contentRepositoryId;) - node references (of scope aggregate) setting is not straight forward
- node property (of scope aggregate) setting is not straight forward
- node property of scope aggregate reading is not straight forward -> see pr and description https://github.com/neos/neos-development-collection/pull/4779
- for the case one is interested in a single arbitrary node - for reading its aggregate scoped properties - one must retrieve it via a hack
- creating a node aggregate in all dimensions is not straight forward -> as one needs an
$arbitraryRootDimensionSpacePointand use CreateNodeVariant? https://github.com/neos/neos-development-collection/blob/13ee7bfc51bd44dcd9a60f7d0cfd426043509cf7/Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php#L114-L146 - deleting the node across all dimensions is not straight forward -> as one needs an
$arbitraryDimensionSpacePointhttps://github.com/neos/neos-development-collection/blob/13ee7bfc51bd44dcd9a60f7d0cfd426043509cf7/Neos.Neos/Classes/Domain/Service/SiteServiceInternals.php#L46-L80