Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
19 / 19 |
|
100.00% |
5 / 5 |
CRAP | |
100.00% |
1 / 1 |
Queue | |
100.00% |
19 / 19 |
|
100.00% |
5 / 5 |
6 | |
100.00% |
1 / 1 |
getDefaults | |
100.00% |
10 / 10 |
|
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 | 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 | ]; |
25 | } |
26 | |
27 | public function setProcess(Process $parentProcess) |
28 | { |
29 | $this->process = $parentProcess; |
30 | return $this; |
31 | } |
32 | |
33 | public function getProcess() |
34 | { |
35 | if ($this->process instanceof Process) { |
36 | $process = clone $this->process; |
37 | $process->queue = clone $this; |
38 | return $process; |
39 | } |
40 | return null; |
41 | } |
42 | |
43 | public function withReference($additionalData = []) |
44 | { |
45 | return clone $this; |
46 | } |
47 | |
48 | /** |
49 | * Keep empty, no sub-instances |
50 | * ATTENTION: Keep highly optimized, time critical function |
51 | */ |
52 | public function __clone() |
53 | { |
54 | } |
55 | } |