|
1
|
|
|
<?php declare(strict_types=1); |
|
2
|
|
|
|
|
3
|
|
|
namespace Modelarium\Laravel\Directives; |
|
4
|
|
|
|
|
5
|
|
|
use Modelarium\Exception\SkipGenerationException; |
|
6
|
|
|
use Modelarium\Laravel\Targets\EventGenerator; |
|
7
|
|
|
use Modelarium\Laravel\Targets\FactoryGenerator; |
|
8
|
|
|
use Modelarium\Laravel\Targets\Interfaces\EventDirectiveInterface; |
|
9
|
|
|
use Modelarium\Laravel\Targets\Interfaces\FactoryDirectiveInterface; |
|
10
|
|
|
use Modelarium\Laravel\Targets\ModelGenerator; |
|
11
|
|
|
use Modelarium\Laravel\Targets\Interfaces\ModelDirectiveInterface; |
|
12
|
|
|
use Modelarium\Laravel\Targets\Interfaces\PolicyDirectiveInterface; |
|
13
|
|
|
use Modelarium\Laravel\Targets\Interfaces\SeedDirectiveInterface; |
|
14
|
|
|
use Modelarium\Laravel\Targets\SeedGenerator; |
|
15
|
|
|
|
|
16
|
|
|
class ModelSkipDirective implements ModelDirectiveInterface, SeedDirectiveInterface, FactoryDirectiveInterface |
|
17
|
|
|
{ |
|
18
|
|
|
public static function processModelTypeDirective( |
|
19
|
|
|
ModelGenerator $generator, |
|
20
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
21
|
|
|
): void { |
|
22
|
|
|
throw new SkipGenerationException(); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public static function processModelFieldDirective( |
|
26
|
|
|
ModelGenerator $generator, |
|
27
|
|
|
\GraphQL\Type\Definition\FieldDefinition $field, |
|
28
|
|
|
\Formularium\Field $fieldFormularium, |
|
29
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
30
|
|
|
): void { |
|
31
|
|
|
} |
|
32
|
|
|
|
|
33
|
|
|
public static function processModelRelationshipDirective( |
|
34
|
|
|
ModelGenerator $generator, |
|
35
|
|
|
\GraphQL\Type\Definition\FieldDefinition $field, |
|
36
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
37
|
|
|
): string { |
|
38
|
|
|
return ''; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
|
|
public static function processSeedTypeDirective( |
|
42
|
|
|
SeedGenerator $generator, |
|
43
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
44
|
|
|
): void { |
|
45
|
|
|
throw new SkipGenerationException(); |
|
46
|
|
|
} |
|
47
|
|
|
|
|
48
|
|
|
public static function processSeedFieldDirective( |
|
49
|
|
|
SeedGenerator $generator, |
|
50
|
|
|
\GraphQL\Type\Definition\FieldDefinition $field, |
|
51
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
52
|
|
|
): void { |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public static function processFactoryTypeDirective( |
|
56
|
|
|
FactoryGenerator $generator, |
|
57
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
58
|
|
|
): void { |
|
59
|
|
|
throw new SkipGenerationException(); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public static function processFactoryFieldDirective( |
|
63
|
|
|
FactoryGenerator $generator, |
|
64
|
|
|
\GraphQL\Type\Definition\FieldDefinition $field, |
|
65
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
|
66
|
|
|
): void { |
|
67
|
|
|
} |
|
68
|
|
|
} |
|
69
|
|
|
|