Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
| core_kernel_rules_Rule | |
0.00% |
0 / 10 |
|
0.00% |
0 / 1 |
6 | |
0.00% |
0 / 1 |
| getExpression | |
0.00% |
0 / 10 |
|
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) 2007-2010 (original work) Public Research Centre Henri Tudor & University of Luxembourg |
| 19 | * (under the project TAO-QUAL); |
| 20 | * 2008-2010 (update and modification) Deutsche Institut für Internationale Pädagogische Forschung |
| 21 | * (under the project TAO-TRANSFER); |
| 22 | * 2017 (update and modification) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 23 | */ |
| 24 | |
| 25 | use oat\generis\model\RulesRdf; |
| 26 | |
| 27 | /** |
| 28 | * Short description of class core_kernel_rules_Rule |
| 29 | * |
| 30 | * @access public |
| 31 | * @author firstname and lastname of author, <author@example.org> |
| 32 | * @package generis |
| 33 | |
| 34 | */ |
| 35 | class core_kernel_rules_Rule extends core_kernel_classes_Resource |
| 36 | { |
| 37 | // --- ASSOCIATIONS --- |
| 38 | |
| 39 | |
| 40 | // --- ATTRIBUTES --- |
| 41 | |
| 42 | /** |
| 43 | * Short description of attribute expression |
| 44 | * |
| 45 | * @access public |
| 46 | * @var Expression |
| 47 | */ |
| 48 | public $expression = null; |
| 49 | // --- OPERATIONS --- |
| 50 | |
| 51 | /** |
| 52 | * Short description of method getExpression |
| 53 | * |
| 54 | * @access public |
| 55 | * @author firstname and lastname of author, <author@example.org> |
| 56 | * @return core_kernel_rules_Expression |
| 57 | */ |
| 58 | public function getExpression() |
| 59 | { |
| 60 | $returnValue = null; |
| 61 | common_Logger::i('Evaluating rule ' . $this->getLabel() . '(' . $this->getUri() . ')', ['Generis Rule']); |
| 62 | if (empty($this->expression)) { |
| 63 | $property = new core_kernel_classes_Property(RulesRdf::PROPERTY_RULE_IF); |
| 64 | $this->expression = new core_kernel_rules_Expression( |
| 65 | $this->getUniquePropertyValue($property)->getUri(), |
| 66 | __METHOD__ |
| 67 | ); |
| 68 | } |
| 69 | $returnValue = $this->expression; |
| 70 | return $returnValue; |
| 71 | } |
| 72 | } |