Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 4 |
CRAP | |
0.00% |
0 / 1 |
| core_kernel_classes_MultiplePropertyValuesException | |
0.00% |
0 / 9 |
|
0.00% |
0 / 4 |
20 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 6 |
|
0.00% |
0 / 1 |
2 | |||
| getProperty | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getResource | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getSeverity | |
0.00% |
0 / 1 |
|
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) 2015 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT); |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | /** |
| 23 | * Thrown when retrieving an expected property |
| 24 | * and finding more than expected (usualy via getUniqueProperty()) |
| 25 | * |
| 26 | * |
| 27 | * @access public |
| 28 | * @author Lionel Lecaque, lionel@taotesting.com |
| 29 | * @package generis |
| 30 | */ |
| 31 | class core_kernel_classes_MultiplePropertyValuesException extends common_Exception |
| 32 | { |
| 33 | /** |
| 34 | * @access private |
| 35 | * @var core_kernel_classes_Property |
| 36 | */ |
| 37 | private $property = null; |
| 38 | |
| 39 | /** |
| 40 | * @access private |
| 41 | * @var core_kenel_classes_Resource |
| 42 | */ |
| 43 | private $resource = null; |
| 44 | |
| 45 | |
| 46 | /** |
| 47 | * Short description of method __construct |
| 48 | * |
| 49 | * @access public |
| 50 | * @param core_kernel_classes_Resource resource |
| 51 | * @param core_kernel_classes_Property property |
| 52 | * @return mixed |
| 53 | */ |
| 54 | public function __construct(core_kernel_classes_Resource $resource, core_kernel_classes_Property $property) |
| 55 | { |
| 56 | $this->resource = $resource; |
| 57 | $this->property = $property; |
| 58 | |
| 59 | parent::__construct( |
| 60 | 'Property ( ' . $property->getUri() . ' ) of resource ' . ' ( ' . $resource->getUri() |
| 61 | . ' ) has more than one value do not use getUniquePropertyValue but use getPropertyValue instead' |
| 62 | ); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Returns the property that was empty |
| 67 | * |
| 68 | * @access public |
| 69 | * @return core_kernel_classes_Property |
| 70 | */ |
| 71 | public function getProperty() |
| 72 | { |
| 73 | return $this->property; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Returns the resource with the empty property |
| 78 | * |
| 79 | * @access public |
| 80 | * @return core_kernel_classes_Resource |
| 81 | */ |
| 82 | public function getResource() |
| 83 | { |
| 84 | return $this->resource; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Returns the severity of the exception |
| 89 | * Used in the common/Logger |
| 90 | * |
| 91 | * @return number |
| 92 | */ |
| 93 | public function getSeverity() |
| 94 | { |
| 95 | return common_Logger::WARNING_LEVEL; |
| 96 | } |
| 97 | } |