Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 11 |
|
0.00% |
0 / 7 |
CRAP | |
0.00% |
0 / 1 |
| InstantActionOnQueueEvent | |
0.00% |
0 / 11 |
|
0.00% |
0 / 7 |
56 | |
0.00% |
0 / 1 |
| getName | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| __construct | |
0.00% |
0 / 5 |
|
0.00% |
0 / 1 |
2 | |||
| getInstantQueueKey | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getUser | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPositions | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getActionType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getQueuedAction | |
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) 2018 (original work) Open Assessment Technologies SA; |
| 19 | * |
| 20 | * @author Alexander Zagovorichev <zagovorichev@1pt.com> |
| 21 | */ |
| 22 | |
| 23 | namespace oat\tao\model\actionQueue\event; |
| 24 | |
| 25 | use oat\oatbox\event\Event; |
| 26 | use oat\oatbox\user\User; |
| 27 | use oat\tao\model\actionQueue\QueuedAction; |
| 28 | |
| 29 | /** |
| 30 | * Event triggered whenever a new instant action is initialised |
| 31 | */ |
| 32 | class InstantActionOnQueueEvent implements Event |
| 33 | { |
| 34 | public const EVENT_NAME = __CLASS__; |
| 35 | |
| 36 | /** |
| 37 | * (non-PHPdoc) |
| 38 | * @see \oat\oatbox\event\Event::getName() |
| 39 | */ |
| 40 | public function getName() |
| 41 | { |
| 42 | return self::EVENT_NAME; |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * @var string |
| 47 | */ |
| 48 | private $instantQueueKey = ''; |
| 49 | |
| 50 | /** |
| 51 | * @var User |
| 52 | */ |
| 53 | private $user; |
| 54 | |
| 55 | /** |
| 56 | * @var array |
| 57 | */ |
| 58 | private $positions = []; |
| 59 | |
| 60 | /** |
| 61 | * @var QueuedAction |
| 62 | */ |
| 63 | private $queuedAction = ''; |
| 64 | |
| 65 | /** |
| 66 | * @var string |
| 67 | */ |
| 68 | private $actionType; |
| 69 | |
| 70 | /** |
| 71 | * InstantActionOnQueueEvent constructor. |
| 72 | * @param string $instantQueueKey |
| 73 | * @param User $user |
| 74 | * @param array $positions |
| 75 | * @param string $actionType |
| 76 | * @param QueuedAction $action |
| 77 | */ |
| 78 | public function __construct($instantQueueKey, User $user, $positions, $actionType = '', QueuedAction $action = null) |
| 79 | { |
| 80 | $this->instantQueueKey = $instantQueueKey; |
| 81 | $this->user = $user; |
| 82 | $this->positions = $positions; |
| 83 | $this->queuedAction = $action; |
| 84 | $this->actionType = $actionType; |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * @return string |
| 89 | */ |
| 90 | public function getInstantQueueKey() |
| 91 | { |
| 92 | return $this->instantQueueKey; |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * @return \oat\oatbox\user\User |
| 97 | */ |
| 98 | public function getUser() |
| 99 | { |
| 100 | return $this->user; |
| 101 | } |
| 102 | |
| 103 | /** |
| 104 | * @return array |
| 105 | */ |
| 106 | public function getPositions() |
| 107 | { |
| 108 | return $this->positions; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * @return string |
| 113 | */ |
| 114 | public function getActionType() |
| 115 | { |
| 116 | return $this->actionType; |
| 117 | } |
| 118 | |
| 119 | /** |
| 120 | * @return QueuedAction |
| 121 | */ |
| 122 | public function getQueuedAction() |
| 123 | { |
| 124 | return $this->queuedAction; |
| 125 | } |
| 126 | } |