1 | <?php |
||
26 | class SiteService implements SingletonInterface |
||
27 | { |
||
28 | |||
29 | /** @var array */ |
||
30 | protected $sites = []; |
||
31 | |||
32 | /** |
||
33 | * Initialize domain configuration |
||
34 | * @param array $sites |
||
35 | */ |
||
36 | public function __construct(array $sites = []) |
||
40 | |||
41 | /** |
||
42 | * @param int $rootPageId |
||
43 | * @return string |
||
44 | */ |
||
45 | public function getFirstDomainForRootPage(int $rootPageId): string |
||
50 | |||
51 | /** |
||
52 | * Returns the configured domain from a site array or an empty string. |
||
53 | * |
||
54 | * @param array $site |
||
55 | * @return string |
||
56 | */ |
||
57 | protected function getFirstDomainFromSiteArray(array $site): string |
||
61 | |||
62 | /** |
||
63 | * Retrieves the configured site for a rootPageId. |
||
64 | * |
||
65 | * @param int $pageId |
||
66 | * @return array |
||
67 | */ |
||
68 | protected function getSiteForRootPageId(int $pageId): array |
||
72 | } |
||
73 |