Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| core_kernel_classes_ResourceFactory | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |
0.00% |
0 / 1 |
| create | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
12 | |||
| 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 | * 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung |
| 21 | * (under the project TAO-TRANSFER); |
| 22 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 23 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 24 | * 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 25 | */ |
| 26 | |
| 27 | use oat\generis\model\OntologyRdfs; |
| 28 | |
| 29 | /** |
| 30 | * Short description of class core_kernel_classes_ResourceFactory |
| 31 | * |
| 32 | * @access public |
| 33 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 34 | * @package generis |
| 35 | * @deprecated breaks dependency injection |
| 36 | */ |
| 37 | class core_kernel_classes_ResourceFactory |
| 38 | { |
| 39 | // --- ASSOCIATIONS --- |
| 40 | |
| 41 | |
| 42 | // --- ATTRIBUTES --- |
| 43 | |
| 44 | // --- OPERATIONS --- |
| 45 | |
| 46 | /** |
| 47 | * Short description of method create |
| 48 | * |
| 49 | * @access public |
| 50 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 51 | * @param Class type |
| 52 | * @param string label |
| 53 | * @param string comment |
| 54 | * @return core_kernel_classes_Resource |
| 55 | * @deprecated breaks dependency injection |
| 56 | */ |
| 57 | public static function create(core_kernel_classes_Class $type, $label = '', $comment = '') |
| 58 | { |
| 59 | $returnValue = null; |
| 60 | $propertiesValues = []; |
| 61 | if (!empty($label)) { |
| 62 | $propertiesValues[OntologyRdfs::RDFS_LABEL] = $label; |
| 63 | } |
| 64 | |
| 65 | if (!empty($comment)) { |
| 66 | $propertiesValues[OntologyRdfs::RDFS_COMMENT] = $comment; |
| 67 | } |
| 68 | |
| 69 | $returnValue = $type->createInstanceWithProperties($propertiesValues); |
| 70 | return $returnValue; |
| 71 | } |
| 72 | } |