You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.
We want to add ORM support for a long time, but are always facing a big issue: There is no way to allow dynamic content to be bound to routes or the like. E.g. the same route entity should be able to bind to StaticContent and Page.
This morning, I came up with a solution for this: As content property, save the class of the content object and it's identifier. When fetching the route, return a proxy of the route object. As soon as $route->getContent() is called, fetch the content object from the database and return it. This can of course be applied to any entity that requires it.
This means that 2 queries are needed, but I don't think we can make ORM as optimized as PHPCR. PHPCR is, after all, the first class citizen and main feature of the CMF.
The text was updated successfully, but these errors were encountered:
this would certainly be doable, yes. people will not read the warning
that this can be a bit slow, and be surprised about performance issues
when they have a site that grows big. but i think the approach is sensible.
there were several attempts at "doctrine bridges" that would allow to
link entity/document between storages, doctrine variants or with other
sources. your approach sounds like re-doing that for a particular case.
but it would just be one implementation of a repository, thus i don't
have a big issue with that. and it would be more contained than adding
one of those bridges (that afaik none are up-to date and maintained, so
not production-ready)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
We want to add ORM support for a long time, but are always facing a big issue: There is no way to allow dynamic content to be bound to routes or the like. E.g. the same route entity should be able to bind to
StaticContent
andPage
.This morning, I came up with a solution for this: As
content
property, save the class of the content object and it's identifier. When fetching the route, return a proxy of the route object. As soon as$route->getContent()
is called, fetch the content object from the database and return it. This can of course be applied to any entity that requires it.This means that 2 queries are needed, but I don't think we can make ORM as optimized as PHPCR. PHPCR is, after all, the first class citizen and main feature of the CMF.
The text was updated successfully, but these errors were encountered: