P
P
pink2floyd2019-04-29 03:19:25
symfony
pink2floyd, 2019-04-29 03:19:25

How to work with doctrine outside AbstractController?

Good afternoon. Tell me how to work with getDoctrine() ->getRepository(ProductType::class) if I don't include AbstractController

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Derepko, 2019-04-29
@pink2floyd

Through dependency injection. In the container, the doctrine is available through the EntityManagerInterface

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question