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 | public function getDefaults() |
14 | { |
15 | return [ |
16 | "arrivalTime" => 0, |
17 | "callCount" => 0, |
18 | "callTime" => 0, |
19 | "number" => 0, |
20 | "waitingTimeEstimate" => 0, |
21 | "waitingTimeOptimistic" => 0, |
22 | "waitingTime" => 0, |
23 | "wayTime" => 0, |
24 | "priority" => null |
25 | ]; |
26 | } |
27 | |
28 | public function setProcess(Process $parentProcess) |
29 | { |
30 | $this->process = $parentProcess; |
31 | return $this; |
32 | } |
33 | |
34 | public function getProcess() |
35 | { |
36 | if ($this->process instanceof Process) { |
37 | $process = clone $this->process; |
38 | $process->queue = clone $this; |
39 | return $process; |
40 | } |
41 | return null; |
42 | } |
43 | |
44 | public function withReference($additionalData = []) |
45 | { |
46 | return clone $this; |
47 | } |
48 | |
49 | /** |
50 | * Keep empty, no sub-instances |
51 | * ATTENTION: Keep highly optimized, time critical function |
52 | */ |
53 | public function __clone() |
54 | { |
55 | } |
56 | } |