2 declare(strict_types = 1);
57 SiteConfiguration::class,
69 public function getAllSites(
bool $useCache =
true): array
71 if ($useCache ===
false) {
87 if (isset($this->mappingRootPageIdToIdentifier[$rootPageId])) {
88 return $this->sites[$this->mappingRootPageIdToIdentifier[$rootPageId]];
102 if (isset($this->sites[$identifier])) {
103 return $this->sites[$identifier];
117 public function getSiteByPageId(
int $pageId, array $rootLine =
null,
string $mountPointParameter =
null):
Site
123 if (!is_array($rootLine)) {
125 $rootLine = GeneralUtility::makeInstance(RootlineUtility::class, $pageId, $mountPointParameter)->get();
133 foreach ($rootLine as $pageInRootLine) {
134 if (isset($this->mappingRootPageIdToIdentifier[(
int)$pageInRootLine[
'uid']])) {
135 return $this->sites[$this->mappingRootPageIdToIdentifier[(int)$pageInRootLine[
'uid']]];
146 $this->sites = $this->siteConfiguration->getAllExistingSites($useCache);
147 foreach ($this->sites as $identifier => $site) {
148 $this->mappingRootPageIdToIdentifier[$site->getRootPageId()] = $identifier;