|
1
|
|
|
<?php |
|
2
|
|
|
/******************************************************************************* |
|
3
|
|
|
* This file is part of the GraphQL Bundle package. |
|
4
|
|
|
* |
|
5
|
|
|
* (c) YnloUltratech <[email protected]> |
|
6
|
|
|
* |
|
7
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
8
|
|
|
* file that was distributed with this source code. |
|
9
|
|
|
******************************************************************************/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Ynlo\GraphQLBundle\Extension; |
|
12
|
|
|
|
|
13
|
|
|
use Doctrine\ORM\QueryBuilder; |
|
14
|
|
|
use Symfony\Component\Form\FormEvent; |
|
15
|
|
|
use Ynlo\GraphQLBundle\Model\NodeInterface; |
|
16
|
|
|
use Ynlo\GraphQLBundle\Resolver\ResolverContext; |
|
17
|
|
|
use Ynlo\GraphQLBundle\Validator\ConstraintViolationList; |
|
18
|
|
|
|
|
19
|
|
|
/** |
|
20
|
|
|
* Base extension for all GraphQL extensions |
|
21
|
|
|
*/ |
|
22
|
|
|
abstract class AbstractExtension implements ExtensionInterface |
|
23
|
|
|
{ |
|
24
|
|
|
/** |
|
25
|
|
|
* {@inheritdoc} |
|
26
|
|
|
*/ |
|
27
|
|
|
public function getPriority(): int |
|
28
|
|
|
{ |
|
29
|
|
|
return 0; |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* {@inheritdoc} |
|
34
|
|
|
*/ |
|
35
|
4 |
|
public function configureQuery(QueryBuilder $queryBuilder, $resolver, ResolverContext $context) |
|
36
|
|
|
{ |
|
37
|
|
|
// TODO: Implement configureQuery() method. |
|
38
|
4 |
|
} |
|
39
|
|
|
|
|
40
|
|
|
/** |
|
41
|
|
|
*{@inheritDoc} |
|
42
|
|
|
*/ |
|
43
|
4 |
|
public function preSetData(FormEvent $event) |
|
44
|
|
|
{ |
|
45
|
|
|
// TODO: Implement preSetData() method. |
|
46
|
4 |
|
} |
|
47
|
|
|
|
|
48
|
|
|
/** |
|
49
|
|
|
*{@inheritDoc} |
|
50
|
|
|
*/ |
|
51
|
4 |
|
public function postSetData(FormEvent $event) |
|
52
|
|
|
{ |
|
53
|
|
|
// TODO: Implement postSetData() method. |
|
54
|
4 |
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
*{@inheritDoc} |
|
58
|
|
|
*/ |
|
59
|
4 |
|
public function preSubmit(FormEvent $event) |
|
60
|
|
|
{ |
|
61
|
|
|
// TODO: Implement preSubmit() method. |
|
62
|
4 |
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
*{@inheritDoc} |
|
66
|
|
|
*/ |
|
67
|
|
|
public function onSubmit(FormEvent $event) |
|
68
|
|
|
{ |
|
69
|
|
|
// TODO: Implement onSubmit() method. |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
*{@inheritDoc} |
|
74
|
|
|
*/ |
|
75
|
4 |
|
public function postSubmit(FormEvent $event) |
|
76
|
|
|
{ |
|
77
|
|
|
// TODO: Implement postSubmit() method. |
|
78
|
4 |
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* {@inheritdoc} |
|
82
|
|
|
*/ |
|
83
|
|
|
public function preValidate(&$data, $resolver, ResolverContext $context) |
|
|
|
|
|
|
84
|
|
|
{ |
|
85
|
|
|
// TODO: Implement preValidate() method. |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* {@inheritdoc} |
|
90
|
|
|
*/ |
|
91
|
|
|
public function postValidation($data, ConstraintViolationList $violations, $resolver, ResolverContext $context) |
|
|
|
|
|
|
92
|
|
|
{ |
|
93
|
|
|
// TODO: Implement postValidation() method. |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* {@inheritdoc} |
|
98
|
|
|
*/ |
|
99
|
4 |
|
public function prePersist(NodeInterface $node, $resolver, ResolverContext $context) |
|
100
|
|
|
{ |
|
101
|
|
|
// TODO: Implement prePersist() method. |
|
102
|
4 |
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* {@inheritdoc} |
|
106
|
|
|
*/ |
|
107
|
4 |
|
public function postPersist(NodeInterface $node, $resolver, ResolverContext $context) |
|
108
|
|
|
{ |
|
109
|
|
|
// TODO: Implement postPersist() method. |
|
110
|
4 |
|
} |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* {@inheritdoc} |
|
114
|
|
|
*/ |
|
115
|
|
|
public function preUpdate(NodeInterface $node, $resolver, ResolverContext $context) |
|
116
|
|
|
{ |
|
117
|
|
|
// TODO: Implement preUpdate() method. |
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* {@inheritdoc} |
|
122
|
|
|
*/ |
|
123
|
|
|
public function postUpdate(NodeInterface $node, $resolver, ResolverContext $context) |
|
124
|
|
|
{ |
|
125
|
|
|
// TODO: Implement postUpdate() method. |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* {@inheritdoc} |
|
130
|
|
|
*/ |
|
131
|
1 |
|
public function preDelete(NodeInterface $node, $resolver, ResolverContext $context) |
|
132
|
|
|
{ |
|
133
|
|
|
// TODO: Implement preDelete() method. |
|
134
|
1 |
|
} |
|
135
|
|
|
|
|
136
|
|
|
/** |
|
137
|
|
|
* {@inheritdoc} |
|
138
|
|
|
*/ |
|
139
|
1 |
|
public function postDelete(NodeInterface $node, $resolver, ResolverContext $context) |
|
140
|
|
|
{ |
|
141
|
|
|
// TODO: Implement postDelete() method. |
|
142
|
1 |
|
} |
|
143
|
|
|
} |
|
144
|
|
|
|
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.