protected function getTranslationOverlaysForPage($pageId, $languageMode)
    {
        $translationOverlays = [];
        $pageId = intval($pageId);

        $languageModes = ['content_fallback', 'strict', 'ignore'];
        $hasOverlayMode = in_array($languageMode, $languageModes,
            true);
        $isContentFallbackMode = ($languageMode === 'content_fallback');

        if ($hasOverlayMode && !$isContentFallbackMode) {
            $translationOverlays = $this->pagesRepository->findTranslationOverlaysByPageId($pageId);
        } else {
            // ! If no sys_language_mode is configured, all languages will be indexed !
            $languages = $this->getSystemLanguages();
            foreach ($languages as $language) {
                if ($language['uid'] <= 0) {
                    continue;
                }
                $translationOverlays[] = [
                    'pid' => $pageId,
                    'l10n_parent' => $pageId,
                    'sys_language_uid' => $language['uid'],
                ];
            }
        }

        return $translationOverlays;
    }
protected function getTranslationOverlaysForPage($pageId, $languageMode)
    {
        $translationOverlays = [];
        $pageId = intval($pageId);

        $languageModes = ['content_fallback', 'strict', 'ignore'];
        $hasOverlayMode = in_array($languageMode, $languageModes,
            true);
        $isContentFallbackMode = ($languageMode === 'content_fallback');

        if ($hasOverlayMode && !$isContentFallbackMode) {
            $translationOverlays = $this->pagesRepository->findTranslationOverlaysByPageId($pageId);
        } else {
            // ! If no sys_language_mode is configured, all languages will be indexed !
            $languages = $this->getSystemLanguages();
            foreach ($languages as $language) {
                if ($language['uid'] <= 0) {
                    continue;
                }
                $translationOverlays[] = [
                    'pid' => $pageId,
                    'l10n_parent' => $pageId,
                    'sys_language_uid' => $language['uid'],
                ];
            }
        }

        return $translationOverlays;
    }
protected function getTranslationOverlaysForPage ( $ pageId , $ languageMode ) { $ translationOverlays = [ ] ; $ pageId = intval ( $ pageId ) ; $ languageModes = [ 'content_fallback' , 'strict' , 'ignore' ] ; $ hasOverlayMode = in_array ( $ languageMode , $ languageModes , true ) ; $ isContentFallbackMode = ( $ languageMode === 'content_fallback' ) ; if ( $ hasOverlayMode && ! $ isContentFallbackMode ) { $ translationOverlays = $ this -> pagesRepository -> findTranslationOverlaysByPageId ( $ pageId ) ; } else { // ! If no sys_language_mode is configured, all languages will be indexed ! $ languages = $ this -> getSystemLanguages ( ) ; foreach ( $ languages as $ language ) { if ( $ language [ 'uid' ] <= 0 ) { continue ; } $ translationOverlays [ ] = [ 'pid' => $ pageId , 'l10n_parent' => $ pageId , 'sys_language_uid' => $ language [ 'uid' ] , ] ; } } return $ translationOverlays ; }
Finds the alternative page language overlay records for a page based on
the sys_language_mode.

Possible Language Modes:
1) content_fallback --> all languages
2) strict --> available languages with page overlay
3) ignore --> available languages with page overlay
4) unknown mode or blank --> all languages

@param int $pageId Page ID.
@param string $languageMode
@return array An array of translation overlays (or fake overlays) found for the given page.
Finds the alternative page language overlay records for a page based on the sys_language_mode .