Question

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.

Was it helpful?

Solution

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"})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top