You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #178 API Platform support: add an --api-resource flag for the make:entity command (dunglas)
This PR was squashed before being merged into the 1.0-dev branch (closes#178).
Discussion
----------
API Platform support: add an --api-resource flag for the make:entity command
This PR adds a new `--api-resource` flag to the `make:entity` command. It allows to automatically a REST endpoint with CRUD operations for the given resource class using API Platform:

I need some guidance about how to add test for this (actually, a few tests are red locally on my Mac even on master).
Fixes#175.
Commits
-------
1c8cf9a Make the Generator class a service
3d2918a Add a functional test
e6ad344 Check if the class exists
ae7c296 Add an interactive question
37b3b9c API Platform support: add an --api-resource flag for the make:entity command
->setDescription('Creates or updates a Doctrine entity class')
74
+
->setDescription('Creates or updates a Doctrine entity class, and optionally an API Platform resource')
63
75
->addArgument('name', InputArgument::OPTIONAL, sprintf('Class name of the entity to create or update (e.g. <fg=yellow>%s</>)', Str::asClassName(Str::getRandomTerm())))
76
+
->addOption('api-resource', 'a', InputOption::VALUE_NONE, 'Mark this class as an API Platform resource (expose a CRUD API for it)')
64
77
->addOption('regenerate', null, InputOption::VALUE_NONE, 'Instead of adding new fields, simply generate the methods (e.g. getter/setter) for existing fields')
65
78
->addOption('overwrite', null, InputOption::VALUE_NONE, 'Overwrite any existing getter/setter methods')
0 commit comments