1 | <?php |
||
8 | class ServerFarmModel |
||
9 | { |
||
10 | /** @var ServerModel[] */ |
||
11 | protected $servers = []; |
||
12 | /** @var ServerModel */ |
||
13 | protected $max; |
||
14 | |||
15 | /** |
||
16 | * ServerFarm constructor. |
||
17 | * |
||
18 | * @param ServerModel $max |
||
19 | */ |
||
20 | public function __construct(ServerModel $max) |
||
24 | |||
25 | /** |
||
26 | * @return ServerModel[] |
||
27 | */ |
||
28 | public function getServers(): array |
||
32 | |||
33 | /** |
||
34 | * Add Virtual machine to the farm. |
||
35 | * |
||
36 | * @param VmachineModel $vmachine |
||
37 | */ |
||
38 | public function addVm(VmachineModel $vmachine) |
||
52 | |||
53 | /** |
||
54 | * Get number of servers needed to store given array of VMs. |
||
55 | * |
||
56 | * @param VMachineModel[] $vmArray |
||
57 | * |
||
58 | * @return ServerModel[] |
||
59 | */ |
||
60 | public function serversNeededForVmachineArray(array $vmArray) |
||
68 | |||
69 | /** |
||
70 | * Store given array of VMs. |
||
71 | * |
||
72 | * @param VMachineModel[] $vmArray |
||
73 | * |
||
74 | * @return $this |
||
75 | */ |
||
76 | public function storeVmachines(array $vmArray) |
||
84 | |||
85 | /** |
||
86 | * Output allocation. |
||
87 | */ |
||
88 | public function toString() |
||
103 | |||
104 | public function count() |
||
108 | } |
||
109 |