Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
88.10% |
37 / 42 |
|
87.10% |
27 / 31 |
CRAP | |
0.00% |
0 / 1 |
| ValueCollectionSearchRequest | |
88.10% |
37 / 42 |
|
87.10% |
27 / 31 |
34.84 | |
0.00% |
0 / 1 |
| hasPropertyUri | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getPropertyUri | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setPropertyUri | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| hasValueCollectionUri | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getValueCollectionUri | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setValueCollectionUri | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| hasUris | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setUris | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getUris | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| hasSubject | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSubject | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSubject | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getExcluded | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| hasExcluded | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| addExcluded | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
| hasOffset | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
2 | |||
| getOffset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setOffset | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| hasLimit | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLimit | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setLimit | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| hasDataLanguage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDataLanguage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setDataLanguage | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getDefaultLanguage | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setDefaultLanguage | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setParentListValues | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| hasParentListValues | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getParentListValues | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSelectedValues | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setSelectedValues | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2020 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | * @author Sergei Mikhailov <sergei.mikhailov@taotesting.com> |
| 21 | */ |
| 22 | |
| 23 | declare(strict_types=1); |
| 24 | |
| 25 | namespace oat\tao\model\Lists\Business\Domain; |
| 26 | |
| 27 | class ValueCollectionSearchRequest |
| 28 | { |
| 29 | /** @var string|null */ |
| 30 | private $propertyUri; |
| 31 | |
| 32 | /** @var string|null */ |
| 33 | private $valueCollectionUri; |
| 34 | |
| 35 | /** @var string|null */ |
| 36 | private $subject; |
| 37 | |
| 38 | /** @var string[] */ |
| 39 | private $excluded = []; |
| 40 | |
| 41 | /** @var int|null */ |
| 42 | private $offset; |
| 43 | |
| 44 | /** @var int|null */ |
| 45 | private $limit; |
| 46 | |
| 47 | /** @var string[] */ |
| 48 | private $uris = []; |
| 49 | |
| 50 | /** @var string */ |
| 51 | private $dataLanguage; |
| 52 | |
| 53 | /** @var string */ |
| 54 | private $defaultLanguage; |
| 55 | |
| 56 | /** @var string[] */ |
| 57 | private $parentListValues; |
| 58 | |
| 59 | /** @var string[] */ |
| 60 | private $selectedValues = []; |
| 61 | |
| 62 | public function hasPropertyUri(): bool |
| 63 | { |
| 64 | return null !== $this->propertyUri; |
| 65 | } |
| 66 | |
| 67 | public function getPropertyUri(): string |
| 68 | { |
| 69 | return $this->propertyUri; |
| 70 | } |
| 71 | |
| 72 | public function setPropertyUri(string $propertyUri): self |
| 73 | { |
| 74 | $this->propertyUri = $propertyUri; |
| 75 | |
| 76 | return $this; |
| 77 | } |
| 78 | |
| 79 | public function hasValueCollectionUri(): bool |
| 80 | { |
| 81 | return !empty($this->valueCollectionUri); |
| 82 | } |
| 83 | |
| 84 | public function getValueCollectionUri(): string |
| 85 | { |
| 86 | return $this->valueCollectionUri; |
| 87 | } |
| 88 | |
| 89 | public function setValueCollectionUri(string $valueCollectionUri): self |
| 90 | { |
| 91 | $this->valueCollectionUri = $valueCollectionUri; |
| 92 | |
| 93 | return $this; |
| 94 | } |
| 95 | |
| 96 | public function hasUris(): bool |
| 97 | { |
| 98 | return !empty($this->uris); |
| 99 | } |
| 100 | |
| 101 | public function setUris(string ...$uri): self |
| 102 | { |
| 103 | $this->uris = $uri; |
| 104 | |
| 105 | return $this; |
| 106 | } |
| 107 | |
| 108 | /** |
| 109 | * @return string[] |
| 110 | */ |
| 111 | public function getUris(): array |
| 112 | { |
| 113 | return $this->uris; |
| 114 | } |
| 115 | |
| 116 | public function hasSubject(): bool |
| 117 | { |
| 118 | return null !== $this->subject; |
| 119 | } |
| 120 | |
| 121 | public function getSubject(): string |
| 122 | { |
| 123 | return $this->subject; |
| 124 | } |
| 125 | |
| 126 | public function setSubject(string $subject): self |
| 127 | { |
| 128 | $this->subject = mb_strtolower($subject); |
| 129 | |
| 130 | return $this; |
| 131 | } |
| 132 | |
| 133 | /** |
| 134 | * @return string[] |
| 135 | */ |
| 136 | public function getExcluded(): array |
| 137 | { |
| 138 | return $this->excluded; |
| 139 | } |
| 140 | |
| 141 | public function hasExcluded(): bool |
| 142 | { |
| 143 | return !empty($this->excluded); |
| 144 | } |
| 145 | |
| 146 | public function addExcluded(string $excluded): self |
| 147 | { |
| 148 | if (!empty($excluded)) { |
| 149 | $this->excluded[] = $excluded; |
| 150 | } |
| 151 | |
| 152 | return $this; |
| 153 | } |
| 154 | |
| 155 | public function hasOffset(): bool |
| 156 | { |
| 157 | return $this->offset !== null && $this->offset >= 0; |
| 158 | } |
| 159 | |
| 160 | public function getOffset(): ?int |
| 161 | { |
| 162 | return $this->offset; |
| 163 | } |
| 164 | |
| 165 | public function setOffset(int $offset): self |
| 166 | { |
| 167 | $this->offset = $offset; |
| 168 | |
| 169 | return $this; |
| 170 | } |
| 171 | |
| 172 | public function hasLimit(): bool |
| 173 | { |
| 174 | return null !== $this->limit; |
| 175 | } |
| 176 | |
| 177 | public function getLimit(): int |
| 178 | { |
| 179 | return $this->limit; |
| 180 | } |
| 181 | |
| 182 | public function setLimit(int $limit): self |
| 183 | { |
| 184 | $this->limit = $limit; |
| 185 | |
| 186 | return $this; |
| 187 | } |
| 188 | |
| 189 | public function hasDataLanguage(): bool |
| 190 | { |
| 191 | return null !== $this->dataLanguage; |
| 192 | } |
| 193 | |
| 194 | public function getDataLanguage(): ?string |
| 195 | { |
| 196 | return $this->dataLanguage; |
| 197 | } |
| 198 | |
| 199 | public function setDataLanguage(string $dataLanguage): self |
| 200 | { |
| 201 | $this->dataLanguage = $dataLanguage; |
| 202 | |
| 203 | return $this; |
| 204 | } |
| 205 | |
| 206 | public function getDefaultLanguage(): ?string |
| 207 | { |
| 208 | return $this->defaultLanguage; |
| 209 | } |
| 210 | |
| 211 | public function setDefaultLanguage(string $defaultLanguage): void |
| 212 | { |
| 213 | $this->defaultLanguage = $defaultLanguage; |
| 214 | } |
| 215 | |
| 216 | public function setParentListValues(string ...$values): self |
| 217 | { |
| 218 | $this->parentListValues = $values; |
| 219 | |
| 220 | return $this; |
| 221 | } |
| 222 | |
| 223 | public function hasParentListValues(): bool |
| 224 | { |
| 225 | return !empty($this->parentListValues); |
| 226 | } |
| 227 | |
| 228 | public function getParentListValues(): array |
| 229 | { |
| 230 | return $this->parentListValues; |
| 231 | } |
| 232 | |
| 233 | public function getSelectedValues(): array |
| 234 | { |
| 235 | return $this->selectedValues; |
| 236 | } |
| 237 | |
| 238 | public function setSelectedValues(string ...$values): self |
| 239 | { |
| 240 | $this->selectedValues = $values; |
| 241 | |
| 242 | return $this; |
| 243 | } |
| 244 | } |