Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 24 |
|
0.00% |
0 / 8 |
CRAP | |
0.00% |
0 / 1 |
| tao_helpers_translation_RDFTranslationUnit | |
0.00% |
0 / 24 |
|
0.00% |
0 / 8 |
110 | |
0.00% |
0 / 1 |
| getSubject | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getPredicate | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| setSubject | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| setPredicate | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| hasSameTranslationUnitSubject | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| hasSameTranslationUnitPredicate | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| hasSameTranslationUnitSource | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
12 | |||
| setSource | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| 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) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung |
| 19 | * (under the project TAO-TRANSFER); |
| 20 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 21 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * Short description of class tao_helpers_translation_RDFTranslationUnit |
| 27 | * |
| 28 | * @access public |
| 29 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 30 | * @package tao |
| 31 | |
| 32 | */ |
| 33 | class tao_helpers_translation_RDFTranslationUnit extends tao_helpers_translation_TranslationUnit |
| 34 | { |
| 35 | // --- ASSOCIATIONS --- |
| 36 | |
| 37 | |
| 38 | // --- ATTRIBUTES --- |
| 39 | |
| 40 | /** |
| 41 | * Short description of attribute subject |
| 42 | * |
| 43 | * @access private |
| 44 | * @var string |
| 45 | */ |
| 46 | private $subject = ''; |
| 47 | |
| 48 | /** |
| 49 | * Short description of attribute predicate |
| 50 | * |
| 51 | * @access private |
| 52 | * @var string |
| 53 | */ |
| 54 | private $predicate = ''; |
| 55 | |
| 56 | // --- OPERATIONS --- |
| 57 | |
| 58 | /** |
| 59 | * Short description of method getSubject |
| 60 | * |
| 61 | * @access public |
| 62 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 63 | * @return string |
| 64 | */ |
| 65 | public function getSubject() |
| 66 | { |
| 67 | $returnValue = (string) ''; |
| 68 | |
| 69 | |
| 70 | $returnValue = $this->subject; |
| 71 | |
| 72 | |
| 73 | return (string) $returnValue; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Short description of method getPredicate |
| 78 | * |
| 79 | * @access public |
| 80 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 81 | * @return string |
| 82 | */ |
| 83 | public function getPredicate() |
| 84 | { |
| 85 | $returnValue = (string) ''; |
| 86 | |
| 87 | |
| 88 | $returnValue = $this->predicate; |
| 89 | |
| 90 | |
| 91 | return (string) $returnValue; |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Short description of method setSubject |
| 96 | * |
| 97 | * @access public |
| 98 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 99 | * @param string subject |
| 100 | * @return mixed |
| 101 | */ |
| 102 | public function setSubject($subject) |
| 103 | { |
| 104 | |
| 105 | $this->subject = $subject; |
| 106 | $this->addAnnotation('subject', $subject); |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Short description of method setPredicate |
| 111 | * |
| 112 | * @access public |
| 113 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 114 | * @param string predicate |
| 115 | * @return mixed |
| 116 | */ |
| 117 | public function setPredicate($predicate) |
| 118 | { |
| 119 | |
| 120 | $this->predicate = $predicate; |
| 121 | $this->addAnnotation('predicate', $predicate); |
| 122 | } |
| 123 | |
| 124 | /** |
| 125 | * Checks whether or not a given RDFTranslationUnit has the same subject |
| 126 | * value as the current instance. |
| 127 | * |
| 128 | * @access public |
| 129 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 130 | * @param RDFTranslationUnit translationUnit |
| 131 | * @return boolean |
| 132 | */ |
| 133 | public function hasSameTranslationUnitSubject(tao_helpers_translation_RDFTranslationUnit $translationUnit) |
| 134 | { |
| 135 | $returnValue = (bool) false; |
| 136 | |
| 137 | |
| 138 | $returnValue = $this->getSubject() == $translationUnit->getSubject(); |
| 139 | |
| 140 | |
| 141 | return (bool) $returnValue; |
| 142 | } |
| 143 | |
| 144 | /** |
| 145 | * Checks whether or not a given RDFTranslationUnit has the same predicate |
| 146 | * value as the current instance. |
| 147 | * |
| 148 | * @access public |
| 149 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 150 | * @param RDFTranslationUnit translationUnit |
| 151 | * @return boolean |
| 152 | */ |
| 153 | public function hasSameTranslationUnitPredicate(tao_helpers_translation_RDFTranslationUnit $translationUnit) |
| 154 | { |
| 155 | $returnValue = (bool) false; |
| 156 | |
| 157 | |
| 158 | $returnValue = $this->getPredicate() == $translationUnit->getPredicate(); |
| 159 | |
| 160 | |
| 161 | return (bool) $returnValue; |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * Checks wether or not that the current translation unit has the same |
| 166 | * than another one. For RDFTranslationUnits, we consider that two |
| 167 | * units have the same source if their source, subject, predicate and target |
| 168 | * are identical. |
| 169 | * |
| 170 | * @access public |
| 171 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 172 | * @param TranslationUnit translationUnit A translation unit to compare. |
| 173 | * @return boolean |
| 174 | */ |
| 175 | public function hasSameTranslationUnitSource(tao_helpers_translation_TranslationUnit $translationUnit) |
| 176 | { |
| 177 | $returnValue = (bool) false; |
| 178 | |
| 179 | |
| 180 | $returnValue = $this->hasSameTranslationUnitPredicate($translationUnit) && |
| 181 | $this->hasSameTranslationUnitSubject($translationUnit) && |
| 182 | $this->hasSameTranslationUnitTargetLanguage($translationUnit); |
| 183 | |
| 184 | |
| 185 | return (bool) $returnValue; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * Short description of method setSource |
| 190 | * |
| 191 | * @access public |
| 192 | * @author Jerome Bogaerts, <jerome.bogaerts@tudor.lu> |
| 193 | * @param string source |
| 194 | * @return mixed |
| 195 | */ |
| 196 | public function setSource($source) |
| 197 | { |
| 198 | |
| 199 | parent::setSource($source); |
| 200 | $this->addAnnotation('source', $source) |
| 201 | ; |
| 202 | } |
| 203 | } |