ResponseModel.php 1.4 KB
Newer Older
1
2
3
4
<?php

namespace Source\UseCases\Admin\Statistics;

Jacob Priddy's avatar
Jacob Priddy committed
5
use Source\Entities\Door;
6
7
use Source\Entities\DoorFailureRate;

8
9
class ResponseModel
{
10
11
12
13
14
    /**
     * @var \Source\Entities\DoorFailureRate[]
     */
    protected array $failureRates = [];

Jacob Priddy's avatar
Jacob Priddy committed
15
16
17
    protected array $mostUsedDoors = [];

    protected int $activeUsers = 0;
18

Jacob Priddy's avatar
Jacob Priddy committed
19
20
    protected int $doorCount;

21
22
    protected int $missingDoorCount;

23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
    public function addFailureRate(DoorFailureRate $failureRate): void
    {
        $this->failureRates[] = $failureRate;
    }

    public function getFailureRates(): array
    {
        return $this->failureRates;
    }

    public function setActiveUsers(int $active): void
    {
        $this->activeUsers = $active;
    }

Jacob Priddy's avatar
Jacob Priddy committed
38
39
40
41
42
    public function setDoorCount(int $count): void
    {
        $this->doorCount = $count;
    }

43
44
45
46
47
    public function setMissingDoors(int $count): void
    {
        $this->missingDoorCount = $count;
    }

48
49
50
51
    public function getActiveUsers(): int
    {
        return $this->activeUsers;
    }
Jacob Priddy's avatar
Jacob Priddy committed
52
53
54
55
56
57
58
59
60
61

    public function addMostUsedDoor(int $count, Door $door): void
    {
        $this->mostUsedDoors[] = [$door, $count];
    }

    public function getMostUsedDoors(): array
    {
        return $this->mostUsedDoors;
    }
Jacob Priddy's avatar
Jacob Priddy committed
62
63
64
65
66

    public function getDoorCount(): int
    {
        return $this->doorCount;
    }
67
68
69
70
71

    public function getNumberOfMissingDoors(): int
    {
        return $this->missingDoorCount;
    }
72
}