Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 13 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
| PciDataObject | |
0.00% |
0 / 13 |
|
0.00% |
0 / 7 |
110 | |
0.00% |
0 / 1 |
| getResponse | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setResponse | |
0.00% |
0 / 2 |
|
0.00% |
0 / 1 |
2 | |||
| getCreator | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| setCreator | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
12 | |||
| hasCreatorKey | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getCreatorKey | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
| setCreatorKey | |
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) 2016 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | */ |
| 21 | |
| 22 | namespace oat\qtiItemPci\model\portableElement\dataObject; |
| 23 | |
| 24 | use oat\taoQtiItem\model\portableElement\element\PortableElementObject; |
| 25 | |
| 26 | class PciDataObject extends PortableElementObject |
| 27 | { |
| 28 | /** @var array */ |
| 29 | protected $response = []; |
| 30 | /** @var array */ |
| 31 | protected $creator = []; |
| 32 | |
| 33 | /** |
| 34 | * @return array |
| 35 | */ |
| 36 | public function getResponse() |
| 37 | { |
| 38 | return $this->response; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * @param $response |
| 43 | * @return $this |
| 44 | */ |
| 45 | public function setResponse($response) |
| 46 | { |
| 47 | $this->response = $response; |
| 48 | return $this; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * @return array |
| 53 | */ |
| 54 | public function getCreator() |
| 55 | { |
| 56 | return $this->creator; |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * @param $creator |
| 61 | * @return $this |
| 62 | */ |
| 63 | public function setCreator($creator) |
| 64 | { |
| 65 | foreach ($creator as $key => $value) { |
| 66 | if (is_array($value)) { |
| 67 | $this->creator[$key] = $value; |
| 68 | } |
| 69 | } |
| 70 | return $this; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Check if given creator key exists |
| 75 | * |
| 76 | * @param $key |
| 77 | * @return bool |
| 78 | */ |
| 79 | public function hasCreatorKey($key) |
| 80 | { |
| 81 | return (isset($this->creator[$key])); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get creator value associated to the given key |
| 86 | * |
| 87 | * @param $key |
| 88 | * @return null |
| 89 | */ |
| 90 | public function getCreatorKey($key) |
| 91 | { |
| 92 | if ($this->hasCreatorKey($key)) { |
| 93 | return $this->creator[$key]; |
| 94 | } |
| 95 | return null; |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Set creator value associated to the given key |
| 100 | * |
| 101 | * @param $key |
| 102 | * @param $value |
| 103 | * @return mixed |
| 104 | */ |
| 105 | public function setCreatorKey($key, $value) |
| 106 | { |
| 107 | return $this->creator[$key] = $value; |
| 108 | } |
| 109 | } |