Answer the question
In order to leave comments, you need to log in
How to implement a field reference (UPD: "Entity-attribute-value model") in Yii2?
MySQL DB.
The task is that: There is a table USER storing only fields which are at all users (id, login).
There is a USER_PROPERTY table that stores the rest of the user properties in the format (user_id, property_id, value).
And there is a PROPERTYS table in which there is a list of fields for the group and from the description (id, group_id, name, description, lable).
The task is to form a model that will contain all the properties that relate to this user.
1) Is this decision rational? If there are 10 different user groups and each can have up to 10 unique (used only for that group) fields.
2) How to call it humanly for search?
3) Can this be nicely organized in yii2? (if there is somewhere, I will be grateful for the link)
4) If it is impossible to do this somehow in yii2, then an example of a SQL query to collect all the user's properties in 1 line.
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