-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement fixture guesser for Faker extension #4056
Comments
I like the idea. Will definitely make developers life easier. |
nobody is really interested in issue ? |
@Ragazzo anything to discuss here? It is a good feature request but has no prio for the release so it is open here until someone finds time to work on it. See label: "ready for adoption" |
I'm interested but as cebe said it has low priority. Currently I do it manually in the model and that's fine, because I define such mapping once when designing the schema/creating models. One issue is that sometimes fields are dependent, that is in my native language firstname and surname depend on gender and same gender should be passed as argument to the generators. |
@nineinchnick you already can create different template files when one fileds area based on other, since you can define a callback that will have as an argument |
@cebe i am not about someone to implement this, i'll do it, i am about to discuss if one have some requests for this one to improve . |
Issue moved to yiisoft/yii2-faker#19 |
In the
Faker
there are some column guessers like this one and this, their purpose is to help user to avoid manual matching attribute names on correct providers, because in most casesusername
oremail
in table or other storage means simple user name and email that isuserName
andemail
providers inFaker
.In this way it would be great if we will implement such functionality for generating templates based on some tables or mongo collections or other storages. So overall usage of command is :
//generate fixture template for users table, basing on some guessing mechanism php yii fixture/template users
and if for example
users
table containsemail
/username
/first_name
/last_name
and other, the resulting fixture template file will be like this :Overall what we achive :
users
table, orusers
collection in mongo, or some data in redis).What is your thoughts @samdark @qiangxue @cebe @klimov-paul ?
The text was updated successfully, but these errors were encountered: