S
S
Stanislav2019-12-21 15:43:32
symfony
Stanislav, 2019-12-21 15:43:32

Doctrine: What is the best way to set up a connection?

I have an application, Symfony + Doctrine will be used there. I took the symfony-sceleton project in Composer, deployed it, added the Doctrine dependencies, installed them, and eventually expected to see some yaml files in the Doctrine config folder, something like config/packages/doctrine.yaml. But in the end, there was nothing.
Can you tell me how to generate them correctly? Do I need them at all, or can I get by with a self-created factory for the EntityManager (so far I only need this), where I myself will write with my own hands what and where to get in the config created by myself for this matter?
Maybe there are some standard ways to configure all this, when neither a factory nor manual creation of a config is needed, but you can simply set some .env variables that will be used in some automatically created config and then used when the EntityManager is born?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav, 2019-12-21
@lamo4ok

I found the answer myself: for this you need not just install a certain package like doctrine/orm, but install a bundle: doctrine/doctrine- bundle . It is about them that we are talking about when configs are created in the config/ packages folder . This does not mean that you always need a bundle to create a config, and not just a package, but it does mean that not all packages have their own automatically generated configs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question