Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

[RFC] Add ORM support using proxies #240

Open
wouterj opened this issue Jan 28, 2017 · 1 comment
Open

[RFC] Add ORM support using proxies #240

wouterj opened this issue Jan 28, 2017 · 1 comment

Comments

@wouterj
Copy link
Member

wouterj commented Jan 28, 2017

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.

@wouterj wouterj changed the title Add ORM support using proxies [RFC] Add ORM support using proxies Jan 28, 2017
@wouterj wouterj removed the wip/poc label Jan 28, 2017
@dbu
Copy link
Member

dbu commented Jan 29, 2017 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants