0

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?

1 Answer 1

1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.