Answer the question
In order to leave comments, you need to log in
Is it reasonable to use yml with data instead of db and entity?
Hello.
There are three types of lists - categories, actions and skills which will store hierarchical data of one nesting (id -- title -- parent). They told me that they need to be stored in the YML config, and not in the database, arguing that they are unlikely to change in the future, and to write a manager to link this data with the Entity of the project. In my opinion, this is inappropriate hemorrhoids, maybe I just don’t understand something and is this a normal practice?
Okay, if in some cases it is convenient to store data in yml, then how to communicate between these data and doctrine entities? For example ManyToMany relationships?
Answer the question
In order to leave comments, you need to log in
Well, I don't know about the manager. but the repository will have to be written, and in order for all this to work gently with the doctrine, it also has its own hydrator that can shove this data there. As for me, it's easier to store it in the database + write simple cli scripts to manage this business.
Here is another question, if it is more convenient to support it through yaml (after all, it can be stored in git, which simplifies control), then maybe it is better.
It can be stored in a database and edited in YAML.
There are several options. You can, for example, drive from YAML to the database using the command. Or make a page on which the data from the database is transparently loaded for the user and YAML is displayed, and when the user saves it, the data is updated in the database.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question