문제

I am using a Propel parameter converter in one of my controller: (Symfony 2.4.2 + Propel 1.7)

 * @ParamConverter("center", converter="propel", class="MyCompany\Bundle\CoreBundle\Model\Center")

It's work well, but I'd like to add additional filters, typically a on a field isVisible (but the filter may be more complex), it is possible? In fact, what I'd like is to use a custom query function of my model and not the basic findPk() function.

도움이 되었습니까?

해결책

You can add option "repository_method" If you want to specify the repository method to use to find the entity

 * @ParamConverter("center", converter="propel", class="MyCompany\Bundle\CoreBundle\Model\Center", options={"repository_method" = "findByCustomQuery"})
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top