Skip to content
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

[QUESTION] Usage of parameter table-mapping and ignore-tables #6651

Open
2 tasks done
Steinweber opened this issue Apr 2, 2024 · 0 comments
Open
2 tasks done

[QUESTION] Usage of parameter table-mapping and ignore-tables #6651

Steinweber opened this issue Apr 2, 2024 · 0 comments
Labels
question Further information is requested

Comments

@Steinweber
Copy link

Before you submit an issue, please be sure to search through existing issues as well as search through the documentation

  • I've searched all existing issues
  • I've read all relevant documentation I could find

Describe your question

https://hyperf.wiki/3.1/#/en/db/model?id=creating-a-model

Parameter Type Default Value Note
--table-mapping array [] Mapping of table name to model, e.g., ['users:Account']
--ignore-tables array [] Tables to ignore for model generation, e.g., ['users']

According to the documentation, a value such as ['TableA', 'TableB'] should work.
However, the value of --ignore-tables and --table-mapping are used as a string.
So it only works for me if I specify the options and paremeters multiple times.
php bin/hyperf.php gen:model --ignore-tables='case' --ignore-tables='campaign' --table-mapping=user:FooBar --table-mapping=account:AccountFoo

No idea if this is a bug or if I just have no idea how to specify the value as a real array.

In any case, one string per option is returned here:

if (in_array($table, $option->getIgnoreTables())) {

@Steinweber Steinweber added the question Further information is requested label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant