Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
20 / 20 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
| Queue | |
100.00% |
20 / 20 |
|
100.00% |
5 / 5 |
6 | |
100.00% |
1 / 1 |
| getDefaults | |
100.00% |
11 / 11 |
|
100.00% |
1 / 1 |
1 | |||
| setProcess | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| getProcess | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
2 | |||
| withReference | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| __clone | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsentities; |
| 4 | |
| 5 | class Queue extends Schema\Entity implements Helper\NoSanitize |
| 6 | { |
| 7 | public const PRIMARY = 'arrivalTime'; |
| 8 | |
| 9 | public static $schema = "queue.json"; |
| 10 | |
| 11 | protected $process; |
| 12 | |
| 13 | #[\Override] |
| 14 | public function getDefaults() |
| 15 | { |
| 16 | return [ |
| 17 | "arrivalTime" => 0, |
| 18 | "callCount" => 0, |
| 19 | "callTime" => 0, |
| 20 | "number" => 0, |
| 21 | "waitingTimeEstimate" => 0, |
| 22 | "waitingTimeOptimistic" => 0, |
| 23 | "waitingTime" => 0, |
| 24 | "wayTime" => 0, |
| 25 | "priority" => null |
| 26 | ]; |
| 27 | } |
| 28 | |
| 29 | public function setProcess(Process $parentProcess) |
| 30 | { |
| 31 | $this->process = $parentProcess; |
| 32 | return $this; |
| 33 | } |
| 34 | |
| 35 | public function getProcess() |
| 36 | { |
| 37 | if ($this->process instanceof Process) { |
| 38 | $process = clone $this->process; |
| 39 | $process->queue = clone $this; |
| 40 | return $process; |
| 41 | } |
| 42 | return null; |
| 43 | } |
| 44 | |
| 45 | #[\Override] |
| 46 | public function withReference($additionalData = []) |
| 47 | { |
| 48 | return clone $this; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Keep empty, no sub-instances |
| 53 | * ATTENTION: Keep highly optimized, time critical function |
| 54 | */ |
| 55 | #[\Override] |
| 56 | public function __clone() |
| 57 | { |
| 58 | } |
| 59 | } |