1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Overblog\GraphQLBundle\Event; |
4
|
|
|
|
5
|
|
|
use GraphQL\Type\Schema; |
6
|
|
|
use Symfony\Component\EventDispatcher\Event; |
7
|
|
|
|
8
|
|
|
final class ExecutorArgumentsEvent extends Event |
9
|
|
|
{ |
10
|
|
|
/** @var Schema */ |
11
|
|
|
private $schema; |
12
|
|
|
|
13
|
|
|
/** @var string */ |
14
|
|
|
private $requestString; |
15
|
|
|
|
16
|
|
|
/** @var mixed */ |
17
|
|
|
private $rootValue; |
18
|
|
|
|
19
|
|
|
/** @var \ArrayObject */ |
20
|
|
|
private $contextValue; |
21
|
|
|
|
22
|
|
|
/** @var null|array */ |
23
|
|
|
private $variableValue; |
24
|
|
|
|
25
|
|
|
/** @var null|string */ |
26
|
|
|
private $operationName; |
27
|
|
|
|
28
|
61 |
|
public static function create( |
29
|
|
|
Schema $schema, |
30
|
|
|
$requestString, |
31
|
|
|
\ArrayObject $contextValue, |
32
|
|
|
$rootValue = null, |
33
|
|
|
array $variableValue = null, |
34
|
|
|
$operationName = null |
35
|
|
|
) { |
36
|
61 |
|
$instance = new static(); |
37
|
61 |
|
$instance->setSchema($schema); |
38
|
61 |
|
$instance->setRequestString($requestString); |
39
|
61 |
|
$instance->setContextValue($contextValue); |
40
|
61 |
|
$instance->setRootValue($rootValue); |
41
|
61 |
|
$instance->setVariableValue($variableValue); |
42
|
61 |
|
$instance->setOperationName($operationName); |
43
|
|
|
|
44
|
61 |
|
return $instance; |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* @param null|string $operationName |
49
|
|
|
*/ |
50
|
61 |
|
public function setOperationName($operationName = null) |
51
|
|
|
{ |
52
|
61 |
|
$this->operationName = $operationName; |
53
|
61 |
|
} |
54
|
|
|
|
55
|
61 |
|
public function setContextValue(\ArrayObject $contextValue = null) |
56
|
|
|
{ |
57
|
61 |
|
$this->contextValue = $contextValue; |
58
|
61 |
|
} |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @param mixed $rootValue |
62
|
|
|
*/ |
63
|
61 |
|
public function setRootValue($rootValue = null) |
64
|
|
|
{ |
65
|
61 |
|
$this->rootValue = $rootValue; |
66
|
61 |
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @param string $requestString |
70
|
|
|
*/ |
71
|
61 |
|
public function setRequestString($requestString) |
72
|
|
|
{ |
73
|
61 |
|
$this->requestString = $requestString; |
74
|
61 |
|
} |
75
|
|
|
|
76
|
61 |
|
public function setVariableValue(array $variableValue = null) |
77
|
|
|
{ |
78
|
61 |
|
$this->variableValue = $variableValue; |
79
|
61 |
|
} |
80
|
|
|
|
81
|
61 |
|
public function setSchema(Schema $schema) |
82
|
|
|
{ |
83
|
61 |
|
$this->schema = $schema; |
84
|
61 |
|
} |
85
|
|
|
|
86
|
|
|
/** |
87
|
|
|
* @return Schema |
88
|
|
|
*/ |
89
|
61 |
|
public function getSchema() |
90
|
|
|
{ |
91
|
61 |
|
return $this->schema; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return string |
96
|
|
|
*/ |
97
|
61 |
|
public function getRequestString() |
98
|
|
|
{ |
99
|
61 |
|
return $this->requestString; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @return array|null |
104
|
|
|
*/ |
105
|
61 |
|
public function getRootValue() |
106
|
|
|
{ |
107
|
61 |
|
return $this->rootValue; |
108
|
|
|
} |
109
|
|
|
|
110
|
|
|
/** |
111
|
|
|
* @return \ArrayObject |
112
|
|
|
*/ |
113
|
61 |
|
public function getContextValue() |
114
|
|
|
{ |
115
|
61 |
|
return $this->contextValue; |
116
|
|
|
} |
117
|
|
|
|
118
|
|
|
/** |
119
|
|
|
* @return array|null |
120
|
|
|
*/ |
121
|
61 |
|
public function getVariableValue() |
122
|
|
|
{ |
123
|
61 |
|
return $this->variableValue; |
124
|
|
|
} |
125
|
|
|
|
126
|
|
|
/** |
127
|
|
|
* @return null|string |
128
|
|
|
*/ |
129
|
61 |
|
public function getOperationName() |
130
|
|
|
{ |
131
|
61 |
|
return $this->operationName; |
132
|
|
|
} |
133
|
|
|
} |
134
|
|
|
|