Doctrine2 - 有预选钩吗? [英] Doctrine2 - is there a pre-selection hook?
问题描述
谢谢。
使用教义过滤器
Doctrine 2.2具有一个过滤器系统,允许开发人员将SQL添加到查询的条件子句,无论生成SQL的位置(例如,从DQL查询或通过加载关联实体)。
I'm developing a ws with Symfony2 / Doctrine2, and I'm trying to hook into Doctrine2 lifecycle and trigger a function before any SELECT action - but without any luck. Basically, i'd like to dynamically manipulate the selection queries adding limit/offset when certain parameters are found in the request, but it seems that Doctrine2 hooks concern only insert, delete and update actions. Am i missing something?
Thanks.
U have to use Doctrine Filter
Doctrine 2.2 features a filter system that allows the developer to add SQL to the conditional clauses of queries, regardless the place where the SQL is generated (e.g. from a DQL query, or by loading associated entities).
这篇关于Doctrine2 - 有预选钩吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!