How to store the data about social networks in the project?

Good time of day.

The project uses social networks FB, VK, OK, etc. it is necessary to store various information - the name, URL, abbreviation, etc. In the moment it's all scattered on the project in the form of constant arrays. There is the need to collect it all in one place. The question arose - how to implement storage of this data? There were options to create an entity with the relevant fields and store it all in the config or in a separate class. Prompt, please, an optimal variant of solving this problem.

Thanks in advance.
June 10th 19 at 14:49
1 answer
June 10th 19 at 14:51
If it's sensitive data, it is stored in .env.
If it's just the settings (like your case), it is convenient to do the class settings with dynamic json fields
Thanks for the reply. It's just that many entities in the project there is a field, roughly speaking, social_type_id, implying a particular Ids social.networks are in the arrays as keys. I at first sight the most attractive seemed to be the option of creating an entity with the required fields and the corresponding table in the database. Confused only that the data is not dynamic, and justified the creation of additional entities. Such an implementation has the right to exist? - Piper.Gulgowski commented on June 10th 19 at 14:54
The option of creating an entity, no wonder you thought privlekatelnym. It is much more convenient than arrays scattered throughout the app.
Who said that the database should only store dynamic data? Not at all.
Storing entities in the database to enable you to very easily and conveniently joinit her social_type_id and in addition a foreign key gives you referential integrity. - Gretchen40 commented on June 10th 19 at 14:57

Find more questions by tags Designing softwareSymfonyPHP