Completed
Push — master ( 533532...ee214c )
by Rafael
04:23
created

UpdateNodePayload::getClientMutationId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 0
crap 2
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