What I gather is that you're trying to implement some form of ACL/ACM (Access Control List/Matrix). But honestly I think you're overcomplicating that by using real entities to accomplish the task. IHMO an ACL/ACM should be very very fast, and an ORM will usually get in your way.
This is a nice read on ACL/ACM: http://blog.mayflower.de/1944-ACLs-and-Symfony2.html It also shows a bit about Symfony2's ACL component. Although it has some quirks, it's very efficient. More info can be found through Google :) -- Jasper N. Brouwer (@jaspernbrouwer) On 20 January 2015 at 14:15:11, Rekam ([email protected]) wrote: > Thanks for your answer! My use case is quite the one I described. I juste > removed some columns definitions. > Now I was thinking about annotations. Would it be possible to hook into the > process? To give the possibility > to manage dynamic association names? > > Is it an anti-pattern to think the RoleType as a "dependancy" of Role? > There is http://php-di.org/ which is quite > a good piece of code for dependancy injection, and it manage dynamic > stuffs. What do you think about it? > > Le mardi 20 janvier 2015 13:16:16 UTC+1, Jàπ (Jasper N. Brouwer) a écrit : > > > > This is a tricky case to solve with Doctrine. > > > > You cannot use a Mapped Superclass, because you cannot reference it in an > > association (you can only point to real entities). > > > > So inheritance (STI or CTI) is the only solution if you want to go down > > this road. > > > > > > http://doctrine-orm.readthedocs.org/en/latest/reference/inheritance-mapping.html#single-table-inheritance > > > > > > http://doctrine-orm.readthedocs.org/en/latest/reference/inheritance-mapping.html#class-table-inheritance > > > > > > I'm not entirely sure what your complete use-case is, but it might be wise > > to consider if you want to solve it using full blown entities (in stead of > > plain sql/dql). > > > > -- > > Jasper N. Brouwer > > (@jaspernbrouwer) -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
