you can try using filters: http://doctrine-orm.readthedocs.org/en/latest/reference/filters.html
Have a look at the "softdelete" extension which uses filters Le lundi 26 mai 2014 15:05:10 UTC+2, Ulrich Lichtenegger a écrit : > > Hi, > > I have a data model which uses a lot tables like on the image below. Most > of the Entities have columns "validto" and "validfrom" which defines that > the entity is only valid in a specific date range. (e.g. 01-02-2013 to > 31-12-2013) I have to create a Doctrine Class design now, but it would be > great if I would not need to set validto and validfrom in every query. > > Would it be possible to implement a superclass "TimespanEntity" which > provides functions like "getCurrent()" which only returns currently valid > entites? Or what would be a good approach to avoid redundant code? Maybe > implement custom Repositories? > > > Thank you for your help! > > > > > <https://lh6.googleusercontent.com/-gAkcoCSaPNc/U4M3L_dHYaI/AAAAAAAAtjM/Gxh3aKQiFF8/s1600/ausschnitt_doctrine_forum.png> > > -- 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.
