Answer the question
In order to leave comments, you need to log in
How to refer to the second connection in Symfony 2?
Good morning!
There is a question.
I ran into a problem while building the query.
There are two databases, database_one, database_two.
In the yml configuration, I wrote two connections base (database_one) and bigdata (database_two).
Naturally base goes by default.
I can’t figure out / find in the documentation how to use the second connection.
To be more precise, I have no idea how to access bigdata using getRepository
Example
// Так мы обратимся к второй БД.
$this->get('doctrine') ->getRepository('MyBundle:MyEntity', 'bigdata')->findAll();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question