M
M
MasterCopipaster2020-08-01 22:47:07
Doctrine ORM
MasterCopipaster, 2020-08-01 22:47:07

How to include Doctrine in your project?

Guys, I apologize in advance for the smallness of the stupid question, but please explain to the fool, I do not understand.
Here I am in the OF documentation on the site I can’t understand at all what they write about.
I used to use doctrine in symfony and I liked everything, but everything is already set up for you, today I needed to set it up in a project where there is no framework at all, I installed it via composer and everything ... arrived ...
I read the documentation and they I am offered to edit some files in the vendor / doctrine / config folder and the like to change the configs, but this is a damn game, this folder is always in gitignore.
Tell me how I should connect it to my project so that my config would be in the project folder ./config
And entities and repository in the folder /src/orm/entities /src/orm/repository respectively
%) I tried to master the documentation for half a day, but I don’t understand what they write about - it’s generally some kind of dense forest.
I would be grateful for an example with comments or at least links.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2020-08-01
@MasterCopipaster

According to the manual, the creation of EM:
The official dock is simple: https://www.doctrine-project.org/projects/doctrine... A
connection is created, an array is created with paths where the entities lie and an EntityManager is created based on this information .
and registration EM:
You can peep how I'm setting up the doctrine here.
Yes, in the context of a container, but you will see how this is not much different from the original manual:
www.slimframework.com/docs/v3/cookbook/database-do...
Repositories:
Repositories in the doctrine or general (with a limited EntityRepository interface) , or they are created by the factory by you or by hand in general, as in the last link ... If you worked with the symphony, then you know that you had to register turnips ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question