Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ResultSetMapper | |
100.00% |
5 / 5 |
|
100.00% |
2 / 2 |
3 | |
100.00% |
1 / 1 |
| map | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
| getAdvancedSearchChecker | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace oat\tao\model\search; |
| 4 | |
| 5 | use oat\oatbox\service\ConfigurableService; |
| 6 | use oat\tao\model\AdvancedSearch\AdvancedSearchChecker; |
| 7 | |
| 8 | /** |
| 9 | * @deprecated Dynamic columns is managed as a feature for advanced search now. |
| 10 | * This class should not be used anymore |
| 11 | */ |
| 12 | class ResultSetMapper extends ConfigurableService |
| 13 | { |
| 14 | /** |
| 15 | * @deprecated Dynamic columns is managed as a feature for advanced search now. |
| 16 | * This class should not be used anymore |
| 17 | */ |
| 18 | public const SERVICE_ID = 'tao/ResultSetMapper'; |
| 19 | |
| 20 | /** |
| 21 | * @deprecated Dynamic columns is managed as a feature for advanced search now. |
| 22 | * This class should not be used anymore |
| 23 | */ |
| 24 | public const OPTION_STRUCTURE_MAP = 'optionStructureMap'; |
| 25 | |
| 26 | /** |
| 27 | * @deprecated Dynamic columns is managed as a feature for advanced search now. |
| 28 | * This class should not be used anymore |
| 29 | */ |
| 30 | public function map(string $structure) |
| 31 | { |
| 32 | $map = $this->getOption(self::OPTION_STRUCTURE_MAP); |
| 33 | |
| 34 | if (!$this->getAdvancedSearchChecker()->isEnabled()) { |
| 35 | return $map[$structure]['default'] ?? $map['default']; |
| 36 | } |
| 37 | return $map[$structure]['advanced'] ?? $map['default']; |
| 38 | } |
| 39 | |
| 40 | private function getAdvancedSearchChecker(): AdvancedSearchChecker |
| 41 | { |
| 42 | return $this->getServiceLocator()->get(AdvancedSearchChecker::class); |
| 43 | } |
| 44 | } |