Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| core_kernel_classes_Triple | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
| createTriple | |
100.00% |
8 / 8 |
|
100.00% |
1 / 1 |
1 | |||
| 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 core_kernel_classes_Triple |
| 29 | * |
| 30 | * @access public |
| 31 | * @author patrick.plichart@tudor.lu |
| 32 | * @package generis |
| 33 | |
| 34 | */ |
| 35 | class core_kernel_classes_Triple extends core_kernel_classes_Container |
| 36 | { |
| 37 | // --- ASSOCIATIONS --- |
| 38 | |
| 39 | |
| 40 | // --- ATTRIBUTES --- |
| 41 | |
| 42 | /** |
| 43 | * Short description of attribute modelid |
| 44 | * |
| 45 | * @access public |
| 46 | * @var int |
| 47 | */ |
| 48 | public $modelid = 0; |
| 49 | |
| 50 | /** |
| 51 | * Short description of attribute subject |
| 52 | * |
| 53 | * @access public |
| 54 | * @var string |
| 55 | */ |
| 56 | public $subject = ''; |
| 57 | |
| 58 | /** |
| 59 | * Short description of attribute predicate |
| 60 | * |
| 61 | * @access public |
| 62 | * @var string |
| 63 | */ |
| 64 | public $predicate = ''; |
| 65 | |
| 66 | /** |
| 67 | * Short description of attribute object |
| 68 | * |
| 69 | * @access public |
| 70 | * @var string |
| 71 | */ |
| 72 | public $object = ''; |
| 73 | |
| 74 | /** |
| 75 | * Short description of attribute id |
| 76 | * |
| 77 | * @access public |
| 78 | * @var int |
| 79 | */ |
| 80 | public $id = 0; |
| 81 | |
| 82 | /** |
| 83 | * Short description of attribute lg |
| 84 | * |
| 85 | * @access public |
| 86 | * @var string |
| 87 | */ |
| 88 | public $lg = ''; |
| 89 | |
| 90 | /** |
| 91 | * User asking for the triple creation |
| 92 | * |
| 93 | * @access public |
| 94 | * @var string |
| 95 | */ |
| 96 | public $author = ''; |
| 97 | |
| 98 | /** |
| 99 | * Triple creation time |
| 100 | * |
| 101 | * @access public |
| 102 | * @var string |
| 103 | */ |
| 104 | public $epoch = ''; |
| 105 | |
| 106 | /** |
| 107 | * Helper to quickly hydrate a Triple |
| 108 | * @return core_kernel_classes_Triple |
| 109 | */ |
| 110 | public static function createTriple( |
| 111 | int $modelId, |
| 112 | string $subject, |
| 113 | string $predicate, |
| 114 | string $object, |
| 115 | string $lg = '', |
| 116 | string $author = '' |
| 117 | ) { |
| 118 | $triple = new self(); |
| 119 | $triple->modelid = $modelId; |
| 120 | $triple->subject = $subject; |
| 121 | $triple->predicate = $predicate; |
| 122 | $triple->object = $object; |
| 123 | $triple->lg = $lg; |
| 124 | $triple->author = $author; |
| 125 | return $triple; |
| 126 | } |
| 127 | } |