There is an example about @SqlResultSetMapping in
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html
I do not understand where and how i should use it? In controller action? In some custom class or trait?
There is an example about @SqlResultSetMapping in
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html
I do not understand where and how i should use it? In controller action? In some custom class or trait?
You can use it wherever you have access to repository class for entity in which you define it, i.e. from controller:
$em = $this->getDoctrine()->getManager();
$repo = $em->getRepository("SomeCertainBundle:YourEntity");
$results = $repo->createNativeNamedQuery("name-of-the-query")->execute();