Answer the question
In order to leave comments, you need to log in
How to get doctrine container service in symfony 4?
Good day to all, tell me how you can access the doctrine container in an empty class?
I have a class:
class MyClass{
public function work(){
$doctrine = $this->getContainer()->get('doctrine'); // я хочу сделать что то вроде этого
}
}
Answer the question
In order to leave comments, you need to log in
You don't need a doctrine container in an empty class.
What do you want to do in this case? This is done in other ways.
Documentation section explaining how this is done:
https://symfony.com/doc/current/service_container....
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question