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
|
|
|
\Formularium\Datatype $datatype = null |
38
|
|
|
): ?\Formularium\Datatype { |
39
|
|
|
return null; |
40
|
|
|
} |
41
|
|
|
|
42
|
|
|
public static function processSeedTypeDirective( |
43
|
|
|
SeedGenerator $generator, |
44
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
45
|
|
|
): void { |
46
|
|
|
throw new SkipGenerationException(); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
public static function processSeedFieldDirective( |
50
|
|
|
SeedGenerator $generator, |
51
|
|
|
\GraphQL\Type\Definition\FieldDefinition $field, |
52
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
53
|
|
|
): void { |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
public static function processFactoryTypeDirective( |
57
|
|
|
FactoryGenerator $generator, |
58
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
59
|
|
|
): void { |
60
|
|
|
throw new SkipGenerationException(); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public static function processFactoryFieldDirective( |
64
|
|
|
FactoryGenerator $generator, |
65
|
|
|
\GraphQL\Type\Definition\FieldDefinition $field, |
66
|
|
|
\GraphQL\Language\AST\DirectiveNode $directive |
67
|
|
|
): void { |
68
|
|
|
} |
69
|
|
|
} |
70
|
|
|
|