symfony / maker-bundle

Symfony Maker Bundle
https://symfony.com/
MIT License
3.35k stars 406 forks source link

Regenerate entity with api-resource flag #377

Open gregurco opened 5 years ago

gregurco commented 5 years ago

Hello. Thank you for integration of API Platform in make:entity command. Probably I have some specific case, but I would like to know how to treat or to fix it.

I'm doing reverse engineering with DB schema. I crate tables through MySQL Workbench. After that I run next command to create entity with properties for tables in DB:

bin/console doctrine:mapping:import "App\Entity" annotation --path=src/Entity

And the next step is command:

bin/console make:entity --regenerate App

This command generates getters/setter in entity class, but if I try to add --api-resource flag, it is simply ignored and I have to add annotation @ApiResource manually.

Do you have any ideas how to treat this case? I'm also able to contribute it, if any work is required :slightly_smiling_face:

Thanks!

cezar77 commented 3 years ago

Any updates on this?

We have the very same use case, and few dozens of tables. It would be really nice if the option --api-resource would work with already existing entities. I think that's a common scenario.

wmfelipe commented 2 years ago

I have the same issue here.