I’m Symfony 2 project going to define my own param converter for my classes that inherit from TenantableEntityInterface. The framework itself provide a default a DoctrineConverter while my own converter is quite similar but should be the only one to be executed (also for performance reasons).
How priority can be specified with param converters?
/**
* @Service("request.doctrine_tenantable_entity_converter")
* @Tag("request.param_converter")
*/
class DoctrineTenantableEntityConverter implements ParamConverterInterface
{
}
I’ve tried to pass a priority to the converter but it doesn’t work:
/**
* @Route("/show/{id}")
* @Method("GET")
* @ParamConverter("message", class="MyBundle:Message", priority=10)
* @Template
*/
public function showAction(Message $message)
{
}
Ok, found it on an obscure page. Priority (-10 to 10) should be specified at service definition level (i’m using JMSDiExtraBundle).
An higher priority means that your own converter is executed before
DoctrineConverter: