1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PWWEB\Artomator\Commands; |
4
|
|
|
|
5
|
|
|
use InfyOm\Generator\Commands\BaseCommand as Base; |
6
|
|
|
use InfyOm\Generator\Generators\Scaffold\ControllerGenerator; |
7
|
|
|
use InfyOm\Generator\Generators\Scaffold\MenuGenerator; |
8
|
|
|
use InfyOm\Generator\Generators\Scaffold\RequestGenerator; |
9
|
|
|
use InfyOm\Generator\Generators\Scaffold\ViewGenerator; |
10
|
|
|
use PWWEB\Artomator\Generators\GraphQL\GraphQLMutationGenerator; |
11
|
|
|
use PWWEB\Artomator\Generators\GraphQL\GraphQLQueryGenerator; |
12
|
|
|
use PWWEB\Artomator\Generators\GraphQL\GraphQLSubscriptionGenerator; |
13
|
|
|
use PWWEB\Artomator\Generators\GraphQL\GraphQLTypeGenerator; |
14
|
|
|
use PWWEB\Artomator\Generators\Scaffold\RoutesGenerator; |
15
|
|
|
|
16
|
|
|
class BaseCommand extends Base |
17
|
|
|
{ |
18
|
|
|
public function generateGraphQLItems() |
19
|
|
|
{ |
20
|
|
|
if (false === ($this->isSkip('mutations') or $this->isSkip('graphql_mutations'))) { |
21
|
|
|
$mutationGenerator = new GraphQLMutationGenerator($this->commandData); |
22
|
|
|
$mutationGenerator->generate(); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
if (false === ($this->isSkip('queries') or $this->isSkip('graphql_query'))) { |
26
|
|
|
$queryGenerator = new GraphQLQueryGenerator($this->commandData); |
27
|
|
|
$queryGenerator->generate(); |
28
|
|
|
} |
29
|
|
|
|
30
|
|
|
if (false === ($this->isSkip('types') or $this->isSkip('graphql_types'))) { |
31
|
|
|
$typeGenerator = new GraphQLTypeGenerator($this->commandData); |
32
|
|
|
$typeGenerator->generate(); |
33
|
|
|
} |
34
|
|
|
|
35
|
|
|
if ((false === ($this->isSkip('subscription') or $this->isSkip('graphql_subscription'))) and config('pwweb.artomator.options.subscription')) { |
36
|
|
|
$subscriptionGenerator = new GraphQLSubscriptionGenerator($this->commandData); |
37
|
|
|
$subscriptionGenerator->generate(); |
38
|
|
|
} |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function generateScaffoldItems() |
42
|
|
|
{ |
43
|
|
|
if (false === $this->isSkip('requests') and false === $this->isSkip('scaffold_requests')) { |
44
|
|
|
$requestGenerator = new RequestGenerator($this->commandData); |
45
|
|
|
$requestGenerator->generate(); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
if (false === $this->isSkip('controllers') and false === $this->isSkip('scaffold_controller')) { |
49
|
|
|
$controllerGenerator = new ControllerGenerator($this->commandData); |
50
|
|
|
$controllerGenerator->generate(); |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
if (false === $this->isSkip('views')) { |
54
|
|
|
$viewGenerator = new ViewGenerator($this->commandData); |
55
|
|
|
$viewGenerator->generate(); |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
if (false === $this->isSkip('routes') and false === $this->isSkip('scaffold_routes')) { |
59
|
|
|
$routeGenerator = new RoutesGenerator($this->commandData); |
60
|
|
|
$routeGenerator->generate(); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
if (false === $this->isSkip('menu') and $this->commandData->config->getAddOn('menu.enabled')) { |
64
|
|
|
$menuGenerator = new MenuGenerator($this->commandData); |
65
|
|
|
$menuGenerator->generate(); |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|