Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
10 / 10 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| Cluster | |
100.00% |
10 / 10 |
|
100.00% |
3 / 3 |
5 | |
100.00% |
1 / 1 |
| getDefaults | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 | |||
| getName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getScopesWorkstationCount | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
3 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsentities; |
| 4 | |
| 5 | class Cluster extends Schema\Entity |
| 6 | { |
| 7 | public const PRIMARY = 'id'; |
| 8 | |
| 9 | public static $schema = "cluster.json"; |
| 10 | |
| 11 | public function getDefaults() |
| 12 | { |
| 13 | return [ |
| 14 | //'name' => '', |
| 15 | 'scopes' => new Collection\ScopeList(), |
| 16 | ]; |
| 17 | } |
| 18 | |
| 19 | public function getName() |
| 20 | { |
| 21 | return $this->toProperty()->name->get(); |
| 22 | } |
| 23 | |
| 24 | public function getScopesWorkstationCount() |
| 25 | { |
| 26 | $workstationCount = 0; |
| 27 | if ($this->toProperty()->scopes->get()) { |
| 28 | foreach ($this->scopes as $scope) { |
| 29 | $entity = new Scope($scope); |
| 30 | $workstationCount += $entity->status['queue']['workstationCount']; |
| 31 | } |
| 32 | } |
| 33 | return $workstationCount; |
| 34 | } |
| 35 | } |