ProfileQuery::setFreeTextQuery()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Werkspot\KvkApi\Http\Search;
6
7
final class ProfileQuery implements QueryInterface
8
{
9
    /**
10
     * KvK number, identifying number for a registration in the Netherlands Business Register. Consists of 8 digits
11
     *
12
     * @var string
13
     */
14
    private $kvkNumber;
15
16
    /**
17
     * Branch number (Vestigingsnummer), identifying number of a branch. Consists of 12 digits
18
     *
19
     * @var string
20
     */
21
    private $branchNumber;
22
23
    /**
24
     * RSIN is an identification number for legal entities and partnerships. Consist of only digits
25
     *
26
     * @var int
27
     */
28
    private $rsin;
29
30
    /**
31
     * Indication  to include searching through inactive dossiers/deregistered companies.
32
     *
33
     * @note History of inactive companies is after 1 January 2012
34
     *
35
     * @var bool
36
     */
37
    private $includeInactiveRegistrations;
38
39
    /**
40
     * RestrictToMainBranch Search is restricted to main branches.
41
     * @var bool
42
     */
43
    private $restrictToMainBranch;
44
45
    /**
46
     * Defines the search collection for the query
47
     *
48
     * @var string
49
     */
50
    private $site;
51
52
    /**
53
     * User can optionally add a context to identify his result later on
54
     *
55
     * @var string
56
     */
57
    private $context;
58
59
    /**
60
     * Free format text search for in the compiled search description.
61
     *
62
     * @var string
63
     */
64
    private $freeTextQuery;
65
66 52
    public function getKvkNumber(): ?string
67
    {
68 52
        return $this->kvkNumber;
69
    }
70
71 23
    public function setKvkNumber(string $kvkNumber): void
72
    {
73 23
        $this->kvkNumber = $kvkNumber;
74 23
    }
75
76 52
    public function getBranchNumber(): ?string
77
    {
78 52
        return $this->branchNumber;
79
    }
80
81 5
    public function setBranchNumber(string $branchNumber): void
82
    {
83 5
        $this->branchNumber = $branchNumber;
84 5
    }
85
86 52
    public function getRsin(): ?int
87
    {
88 52
        return $this->rsin;
89
    }
90
91 5
    public function setRsin(int $rsin): void
92
    {
93 5
        $this->rsin = $rsin;
94 5
    }
95
96 52
    public function isIncludeInactiveRegistrations(): ?bool
97
    {
98 52
        return $this->includeInactiveRegistrations;
99
    }
100
101 2
    public function setIncludeInactiveRegistrations(bool $includeInactiveRegistrations): void
102
    {
103 2
        $this->includeInactiveRegistrations = $includeInactiveRegistrations;
104 2
    }
105
106 52
    public function isRestrictToMainBranch(): ?bool
107
    {
108 52
        return $this->restrictToMainBranch;
109
    }
110
111 2
    public function setRestrictToMainBranch(bool $restrictToMainBranch): void
112
    {
113 2
        $this->restrictToMainBranch = $restrictToMainBranch;
114 2
    }
115
116 52
    public function getSite(): ?string
117
    {
118 52
        return $this->site;
119
    }
120
121 5
    public function setSite($site): void
122
    {
123 5
        $this->site = $site;
124 5
    }
125
126 52
    public function getContext(): ?string
127
    {
128 52
        return $this->context;
129
    }
130
131 5
    public function setContext(string $context): void
132
    {
133 5
        $this->context = $context;
134 5
    }
135
136 52
    public function getFreeTextQuery(): ?string
137
    {
138 52
        return $this->freeTextQuery;
139
    }
140
141 5
    public function setFreeTextQuery(string $freeTextQuery): void
142
    {
143 5
        $this->freeTextQuery = $freeTextQuery;
144 5
    }
145
146 52
    public function get(): array
147
    {
148
        return [
149 52
            'kvkNumber' => $this->getKvkNumber(),
150 52
            'branchNumber' => $this->getBranchNumber(),
151 52
            'rsin' => $this->getRsin(),
152 52
            'includeInactiveRegistrations' => $this->isIncludeInactiveRegistrations(),
153 52
            'restrictToMainBranch' => $this->isRestrictToMainBranch(),
154 52
            'site' => $this->getSite(),
155 52
            'context' => $this->getContext(),
156 52
            'q' => $this->getFreeTextQuery(),
157
        ];
158
    }
159
}
160