Completed
Pull Request — master (#394)
by Kristof
03:19
created

AddConstraint::getQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace CultuurNet\UDB3\Role\Commands;
4
5
use ValueObjects\Identity\UUID;
6
use CultuurNet\UDB3\Role\ValueObjects\Query;
7
use CultuurNet\UDB3\ValueObject\SapiVersion;
8
9
class AddConstraint extends AbstractCommand
10
{
11
    /**
12
     * @var string
13
     */
14
    private $sapiVersion;
15
16
    /**
17
     * @var Query
18
     */
19
    private $query;
20
21
    /**
22
     * CreateConstraint constructor.
23
     * @param UUID $uuid
24
     * @param SapiVersion $sapiVersion
25
     * @param Query $query
26
     */
27
    public function __construct(
28
        UUID $uuid,
29
        SapiVersion $sapiVersion,
30
        Query $query
31
    ) {
32
        parent::__construct($uuid);
33
        $this->sapiVersion = $sapiVersion->toNative();
34
        $this->query = $query;
35
    }
36
37
    /**
38
     * @return SapiVersion
39
     */
40
    public function getSapiVersion(): SapiVersion
41
    {
42
        return SapiVersion::fromNative($this->sapiVersion);
43
    }
44
45
    /**
46
     * @return Query
47
     */
48
    public function getQuery(): Query
49
    {
50
        return $this->query;
51
    }
52
}
53