overlayType; } /** * Returns the language ID the current page was requested, * this is relevant when building menus or links to other pages. */ public function getId(): int { return $this->id; } /** * Contains the language UID of the content records that should be overlaid to would be fetched. * This is especially useful when a page requested with language=4 should fall back to showing * content of language=2 (see fallbackChain) */ public function getContentId(): int { return $this->contentId ?? $this->id; } public function getFallbackChain(): array { return $this->fallbackChain; } /** * Whether overlays should be done */ public function doOverlays(): bool { return $this->getContentId() > 0 && $this->overlayType !== self::OVERLAYS_OFF; } /** * Here for compatibility reasons */ public function getLegacyLanguageMode(): string { if ($this->fallbackChain === ['off']) { return ''; } if (empty($this->fallbackChain)) { return 'strict'; } return 'content_fallback'; } /** * Here for compatibility reasons */ public function getLegacyOverlayType(): string { return match ($this->overlayType) { self::OVERLAYS_ON_WITH_FLOATING, self::OVERLAYS_ON => 'hideNonTranslated', self::OVERLAYS_MIXED => '1', default => '0', }; } /** * Fetch a property. * * @throws AspectPropertyNotFoundException */ public function get(string $name): int|string|array { switch ($name) { case 'id': return $this->id; case 'contentId': return $this->getContentId(); case 'fallbackChain': return $this->fallbackChain; case 'overlayType': return $this->overlayType; case 'legacyLanguageMode': return $this->getLegacyLanguageMode(); case 'legacyOverlayType': return $this->getLegacyOverlayType(); } throw new AspectPropertyNotFoundException('Property "' . $name . '" not found in Aspect "' . __CLASS__ . '".', 1530448504); } }