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
{{ message }}
This repository was archived by the owner on Jun 19, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: src/Maker/MakeHslCrud.php
+34-44Lines changed: 34 additions & 44 deletions
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,8 @@
25
25
*/
26
26
finalclass MakeHslCrud extends AbstractMaker
27
27
{
28
+
use MakerTrait;
29
+
28
30
private$doctrineHelper;
29
31
30
32
private$inflector;
@@ -50,79 +52,66 @@ public function configureCommand(Command $command, InputConfiguration $inputConf
50
52
{
51
53
$command
52
54
->setDescription('Creates API CRUD for Doctrine entity class')
53
-
->addArgument('entity-class', InputArgument::OPTIONAL, sprintf('The class name of the entity to create CRUD (e.g. <fg=yellow>%s</>)', Str::asClassName(Str::getRandomTerm())))
->addArgument('name', InputArgument::OPTIONAL, sprintf('The class name for new CRUD controller (e.g. <fg=yellow>%s</>)', Str::asClassName(Str::getRandomTerm())))
56
+
->addArgument('entity-name', InputArgument::OPTIONAL, 'The existing entity class for this CRUD')
thrownewRuntimeCommandException(sprintf("You must create a Transformer (make:hsl:transformer) for entity '%s' first.", $entityClassDetails->getFullName()));
109
+
if (!class_exists($transformerClassDetails->getFullName())) {
110
+
thrownewRuntimeCommandException(sprintf("Class \"%s\" does not exist.", $transformerClassDetails->getFullName()));
0 commit comments