我在我的一个控制器中使用了Propel参数转换器:( Symfony 2.4.2 + Propel 1.7 )
* @ParamConverter("center", converter="propel", class="MyCompany\Bundle\CoreBundle\Model\Center")
它运行良好,但我想添加其他过滤器,通常是在字段isVisible
上(但过滤器可能更复杂),有可能吗?事实上,我想要的是使用我的模型的自定义查询功能而不是基本的findPk()
函数。
答案 0 :(得分:4)
您可以添加选项" repository_method"如果要指定用于查找实体的存储库方法
* @ParamConverter("center", converter="propel", class="MyCompany\Bundle\CoreBundle\Model\Center", options={"repository_method" = "findByCustomQuery"})