@@ 19-29 (lines=11) @@ | ||
16 | /** |
|
17 | * @return Site[] |
|
18 | */ |
|
19 | public function getSites(): array |
|
20 | { |
|
21 | $path = 'sites'; |
|
22 | ||
23 | $response = $this->getClient()->sendRequest('GET', $path); |
|
24 | ||
25 | /** @var Site[] $models */ |
|
26 | $models = $this->getModelFactory()->createMany(Site::class, $response); |
|
27 | ||
28 | return $models; |
|
29 | } |
|
30 | ||
31 | /** |
|
32 | * @param int $id |
|
@@ 36-46 (lines=11) @@ | ||
33 | * |
|
34 | * @return Site |
|
35 | */ |
|
36 | public function getSite(int $id): Site |
|
37 | { |
|
38 | $path = sprintf('sites/%d', $id); |
|
39 | ||
40 | $response = $this->getClient()->sendRequest('GET', $path); |
|
41 | ||
42 | /** @var Site $model */ |
|
43 | $model = $this->getModelFactory()->create(Site::class, $response); |
|
44 | ||
45 | return $model; |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * @param SitePostMessage $message |
|
@@ 81-91 (lines=11) @@ | ||
78 | * |
|
79 | * @return Site[] |
|
80 | */ |
|
81 | public function getPlatformChildren(PlatformChildrenListMessage $message): array |
|
82 | { |
|
83 | $path = sprintf('platform/%d/children', $message->getSiteId()); |
|
84 | ||
85 | $response = $this->getClient()->sendRequest('GET', $path); |
|
86 | ||
87 | /** @var Site[] $models */ |
|
88 | $models = $this->getModelFactory()->createMany(Site::class, $response); |
|
89 | ||
90 | return $models; |
|
91 | } |
|
92 | } |
|
93 |