Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| Import | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
20 | |
0.00% |
0 / 1 |
| getAvailableImportHandlers | |
0.00% |
0 / 13 |
|
0.00% |
0 / 1 |
20 | |||
| 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) 2002-2008 (original work) Public Research Centre Henri Tudor & University of Luxembourg |
| 19 | * (under the project TAO & TAO2); |
| 20 | * 2002-2008 (update and modification) Public Research Centre Henri Tudor & University of Luxembourg |
| 21 | * (under the project TAO & TAO2); |
| 22 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 23 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 24 | */ |
| 25 | |
| 26 | declare(strict_types=1); |
| 27 | |
| 28 | namespace oat\taoTestTaker\actions; |
| 29 | |
| 30 | use oat\taoTestTaker\models\CsvImporter; |
| 31 | use oat\taoTestTaker\models\RdfImporter; |
| 32 | use tao_actions_Import; |
| 33 | use tao_models_classes_import_CsvImporter; |
| 34 | use tao_models_classes_import_RdfImporter; |
| 35 | |
| 36 | /** |
| 37 | * Extends the common Import class to exchange the generic |
| 38 | * CsvImporter with a subject specific one |
| 39 | * |
| 40 | * @author Bertrand Chevrier, <taosupport@tudor.lu> |
| 41 | */ |
| 42 | class Import extends tao_actions_Import |
| 43 | { |
| 44 | /** |
| 45 | * @inheritDoc |
| 46 | */ |
| 47 | public function getAvailableImportHandlers() |
| 48 | { |
| 49 | $returnValue = parent::getAvailableImportHandlers(); |
| 50 | |
| 51 | foreach (array_keys($returnValue) as $key) { |
| 52 | switch (get_class($returnValue[$key])) { |
| 53 | case tao_models_classes_import_CsvImporter::class: |
| 54 | $importer = new CsvImporter(); |
| 55 | $importer->setValidators($this->getValidators()); |
| 56 | $returnValue[$key] = $importer; |
| 57 | |
| 58 | break; |
| 59 | case tao_models_classes_import_RdfImporter::class: |
| 60 | $importer = new RdfImporter(); |
| 61 | $returnValue[$key] = $importer; |
| 62 | |
| 63 | break; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | return $returnValue; |
| 68 | } |
| 69 | } |