Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
| tao_models_classes_table_PropertyDP | |
0.00% |
0 / 10 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 1 |
| prepare | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getValue | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
6 | |||
| singleton | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
6 | |||
| 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 | * |
| 25 | */ |
| 26 | |
| 27 | /** |
| 28 | * Short description of class tao_models_classes_table_PropertyDP |
| 29 | * |
| 30 | * @access public |
| 31 | * @author Joel Bout, <joel.bout@tudor.lu> |
| 32 | * @package tao |
| 33 | |
| 34 | */ |
| 35 | class tao_models_classes_table_PropertyDP implements tao_models_classes_table_DataProvider |
| 36 | { |
| 37 | // --- ASSOCIATIONS --- |
| 38 | |
| 39 | |
| 40 | // --- ATTRIBUTES --- |
| 41 | |
| 42 | /** |
| 43 | * Short description of attribute singleton |
| 44 | * |
| 45 | * @access public |
| 46 | * @var PropertyDP |
| 47 | */ |
| 48 | public static $singleton = null; |
| 49 | |
| 50 | /** |
| 51 | * Short description of attribute cache |
| 52 | * |
| 53 | * @access public |
| 54 | * @var array |
| 55 | */ |
| 56 | public $cache = []; |
| 57 | |
| 58 | // --- OPERATIONS --- |
| 59 | |
| 60 | /** |
| 61 | * Short description of method prepare |
| 62 | * |
| 63 | * @access public |
| 64 | * @author Joel Bout, <joel.bout@tudor.lu> |
| 65 | * @param array resources |
| 66 | * @param array columns |
| 67 | * @return mixed |
| 68 | */ |
| 69 | public function prepare($resources, $columns) |
| 70 | { |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Short description of method getValue |
| 75 | * |
| 76 | * @access public |
| 77 | * @author Joel Bout, <joel.bout@tudor.lu> |
| 78 | * @param Resource resource |
| 79 | * @param Column column |
| 80 | * @return string |
| 81 | */ |
| 82 | public function getValue(core_kernel_classes_Resource $resource, tao_models_classes_table_Column $column) |
| 83 | { |
| 84 | $returnValue = (string) ''; |
| 85 | |
| 86 | |
| 87 | $result = $resource->getOnePropertyValue($column->getProperty()); |
| 88 | $returnValue = $result instanceof core_kernel_classes_Resource ? $result->getLabel() : (string)$result; |
| 89 | |
| 90 | |
| 91 | return (string) $returnValue; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Short description of method singleton |
| 96 | * |
| 97 | * @access public |
| 98 | * @author Joel Bout, <joel.bout@tudor.lu> |
| 99 | * @return tao_models_classes_table_PropertyDP |
| 100 | */ |
| 101 | public static function singleton() |
| 102 | { |
| 103 | $returnValue = null; |
| 104 | |
| 105 | |
| 106 | if (is_null(self::$singleton)) { |
| 107 | self::$singleton = new self(); |
| 108 | } |
| 109 | $returnValue = self::$singleton; |
| 110 | |
| 111 | |
| 112 | return $returnValue; |
| 113 | } |
| 114 | } |