Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
83.33% |
15 / 18 |
|
80.00% |
8 / 10 |
CRAP | |
0.00% |
0 / 1 |
| DirectorySearchQuery | |
83.33% |
15 / 18 |
|
80.00% |
8 / 10 |
10.46 | |
0.00% |
0 / 1 |
| __construct | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| getChildrenOffset | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getParentLink | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getFilter | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getDepth | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getChildrenLimit | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getItemUri | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAsset | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getItemLang | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| setChildrenLimit | |
0.00% |
0 / 2 |
|
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) 2020 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | declare(strict_types=1); |
| 23 | |
| 24 | namespace oat\tao\model\media\mediaSource; |
| 25 | |
| 26 | use oat\tao\model\media\MediaAsset; |
| 27 | |
| 28 | class DirectorySearchQuery |
| 29 | { |
| 30 | /** @var string */ |
| 31 | private $parentLink; |
| 32 | |
| 33 | /** @var array */ |
| 34 | private $filter; |
| 35 | |
| 36 | /** @var int */ |
| 37 | private $depth; |
| 38 | |
| 39 | /** @var int */ |
| 40 | private $childrenLimit; |
| 41 | |
| 42 | /** @var int */ |
| 43 | private $childrenOffset; |
| 44 | |
| 45 | /** @var MediaAsset */ |
| 46 | private $asset; |
| 47 | |
| 48 | /** @var string */ |
| 49 | private $itemLang; |
| 50 | |
| 51 | /** @var string */ |
| 52 | private $itemUri; |
| 53 | |
| 54 | public function __construct( |
| 55 | MediaAsset $asset, |
| 56 | string $itemUri, |
| 57 | string $itemLang, |
| 58 | array $filter = [], |
| 59 | int $depth = 1, |
| 60 | int $childrenOffset = 0, |
| 61 | int $childrenLimit = 0 |
| 62 | ) { |
| 63 | $this->parentLink = $asset->getMediaIdentifier(); |
| 64 | $this->filter = $filter; |
| 65 | $this->depth = $depth; |
| 66 | $this->childrenLimit = $childrenLimit; |
| 67 | $this->childrenOffset = $childrenOffset; |
| 68 | $this->asset = $asset; |
| 69 | $this->itemLang = $itemLang; |
| 70 | $this->itemUri = $itemUri; |
| 71 | } |
| 72 | |
| 73 | public function getChildrenOffset(): int |
| 74 | { |
| 75 | return $this->childrenOffset; |
| 76 | } |
| 77 | |
| 78 | public function getParentLink(): string |
| 79 | { |
| 80 | return $this->parentLink; |
| 81 | } |
| 82 | |
| 83 | public function getFilter(): array |
| 84 | { |
| 85 | return $this->filter; |
| 86 | } |
| 87 | |
| 88 | public function getDepth(): int |
| 89 | { |
| 90 | return $this->depth; |
| 91 | } |
| 92 | |
| 93 | public function getChildrenLimit(): int |
| 94 | { |
| 95 | return $this->childrenLimit; |
| 96 | } |
| 97 | |
| 98 | public function getItemUri(): string |
| 99 | { |
| 100 | return $this->itemUri; |
| 101 | } |
| 102 | |
| 103 | public function getAsset(): MediaAsset |
| 104 | { |
| 105 | return $this->asset; |
| 106 | } |
| 107 | |
| 108 | public function getItemLang(): string |
| 109 | { |
| 110 | return $this->itemLang; |
| 111 | } |
| 112 | |
| 113 | public function setChildrenLimit(int $childrenLimit): self |
| 114 | { |
| 115 | $this->childrenLimit = $childrenLimit; |
| 116 | return $this; |
| 117 | } |
| 118 | } |