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\Model; |
12
|
|
|
|
13
|
|
|
use Ynlo\GraphQLBundle\Annotation as GraphQL; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @GraphQL\ObjectType() |
17
|
|
|
*/ |
18
|
|
|
class UpdateNodePayload |
19
|
|
|
{ |
20
|
|
|
/** |
21
|
|
|
* @var mixed |
22
|
|
|
* |
23
|
|
|
* @GraphQL\Field(type="Ynlo\GraphQLBundle\Model\NodeInterface", description="Updated node instance") |
24
|
|
|
*/ |
25
|
|
|
public $node; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var null|string |
29
|
|
|
* |
30
|
|
|
* @GraphQL\Field(type="string", description="Unique client mutation identifier") |
31
|
|
|
*/ |
32
|
|
|
public $clientMutationId; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var ConstraintViolation[] |
36
|
|
|
* |
37
|
|
|
* @GraphQL\Field(type="[Ynlo\GraphQLBundle\Model\ConstraintViolation]", description="List of `ConstraintViolation` if the validation fails.") |
38
|
|
|
*/ |
39
|
|
|
public $constraintViolations = []; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* UpdateNodePayload constructor. |
43
|
|
|
* |
44
|
|
|
* @param NodeInterface|null $node |
45
|
|
|
* @param ConstraintViolation[] $violations |
46
|
|
|
* @param null|string $clientMutationId |
47
|
|
|
*/ |
48
|
|
|
public function __construct(?NodeInterface $node, array $violations = [], ?string $clientMutationId = null) |
49
|
|
|
{ |
50
|
|
|
$this->node = $node; |
51
|
|
|
$this->clientMutationId = $clientMutationId; |
52
|
|
|
$this->constraintViolations = $violations; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @return mixed |
57
|
|
|
*/ |
58
|
|
|
public function getNode() |
59
|
|
|
{ |
60
|
|
|
return $this->node; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return null|string |
65
|
|
|
*/ |
66
|
|
|
public function getClientMutationId():?string |
67
|
|
|
{ |
68
|
|
|
return $this->clientMutationId; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return ConstraintViolation[] |
73
|
|
|
*/ |
74
|
|
|
public function getConstraintViolations(): array |
75
|
|
|
{ |
76
|
|
|
return $this->constraintViolations; |
77
|
|
|
} |
78
|
|
|
} |
79
|
|
|
|