Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
62.07% |
18 / 29 |
|
90.91% |
10 / 11 |
CRAP | |
0.00% |
0 / 1 |
| ResultColumn | |
62.07% |
18 / 29 |
|
90.91% |
10 / 11 |
17.60 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
9 / 9 |
|
100.00% |
1 / 1 |
1 | |||
| getId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getSortId | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAlias | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getClassLabel | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isDuplicated | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isDefault | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| isSortable | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| jsonSerialize | |
0.00% |
0 / 11 |
|
0.00% |
0 / 1 |
2 | |||
| 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) 2022 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | * @author Gabriel Felipe Soares <gabriel.felipe.soares@taotesting.com> |
| 21 | */ |
| 22 | |
| 23 | declare(strict_types=1); |
| 24 | |
| 25 | namespace oat\tao\model\search; |
| 26 | |
| 27 | use JsonSerializable; |
| 28 | |
| 29 | class ResultColumn implements JsonSerializable |
| 30 | { |
| 31 | /** @var string */ |
| 32 | private $id; |
| 33 | |
| 34 | /** @var string */ |
| 35 | private $sortId; |
| 36 | |
| 37 | /** @var string */ |
| 38 | private $label; |
| 39 | |
| 40 | /** @var string */ |
| 41 | private $type; |
| 42 | |
| 43 | /** @var string */ |
| 44 | private $alias; |
| 45 | |
| 46 | /** @var string */ |
| 47 | private $classLabel; |
| 48 | |
| 49 | /** @var bool */ |
| 50 | private $isDuplicated; |
| 51 | |
| 52 | /** @var bool */ |
| 53 | private $default; |
| 54 | |
| 55 | /** @var bool */ |
| 56 | private $sortable; |
| 57 | |
| 58 | public function __construct( |
| 59 | string $id, |
| 60 | string $sortId, |
| 61 | string $label, |
| 62 | string $type, |
| 63 | string $alias = null, |
| 64 | string $classLabel = null, |
| 65 | bool $isDuplicated = false, |
| 66 | bool $default = false, |
| 67 | bool $sortable = false |
| 68 | ) { |
| 69 | $this->id = $id; |
| 70 | $this->sortId = $sortId; |
| 71 | $this->label = $label; |
| 72 | $this->type = $type; |
| 73 | $this->alias = $alias; |
| 74 | $this->classLabel = $classLabel; |
| 75 | $this->isDuplicated = $isDuplicated; |
| 76 | $this->default = $default; |
| 77 | $this->sortable = $sortable; |
| 78 | } |
| 79 | |
| 80 | public function getId(): string |
| 81 | { |
| 82 | return $this->id; |
| 83 | } |
| 84 | |
| 85 | public function getSortId(): string |
| 86 | { |
| 87 | return $this->sortId; |
| 88 | } |
| 89 | |
| 90 | public function getLabel(): string |
| 91 | { |
| 92 | return $this->label; |
| 93 | } |
| 94 | |
| 95 | public function getType(): string |
| 96 | { |
| 97 | return $this->type; |
| 98 | } |
| 99 | |
| 100 | public function getAlias(): ?string |
| 101 | { |
| 102 | return $this->alias; |
| 103 | } |
| 104 | |
| 105 | public function getClassLabel(): ?string |
| 106 | { |
| 107 | return $this->classLabel; |
| 108 | } |
| 109 | |
| 110 | public function isDuplicated(): bool |
| 111 | { |
| 112 | return $this->isDuplicated; |
| 113 | } |
| 114 | |
| 115 | public function isDefault(): bool |
| 116 | { |
| 117 | return $this->default; |
| 118 | } |
| 119 | |
| 120 | public function isSortable(): bool |
| 121 | { |
| 122 | return $this->sortable; |
| 123 | } |
| 124 | |
| 125 | public function jsonSerialize(): array |
| 126 | { |
| 127 | return [ |
| 128 | 'id' => $this->getId(), |
| 129 | 'sortId' => $this->getSortId(), |
| 130 | 'label' => $this->getLabel(), |
| 131 | 'type' => $this->getType(), |
| 132 | 'alias' => $this->getAlias(), |
| 133 | 'classLabel' => $this->getClassLabel(), |
| 134 | 'isDuplicated' => $this->isDuplicated(), |
| 135 | 'default' => $this->isDefault(), |
| 136 | 'sortable' => $this->isSortable(), |
| 137 | ]; |
| 138 | } |
| 139 | } |