public function loadContentLanguages(Content $content): array
    {
        $contentLanguages = $content->versionInfo->languageCodes;

        $filter = function (Language $language) use ($contentLanguages) {
            return $language->enabled && in_array($language->languageCode, $contentLanguages, true);
        };

        $languagesByCode = [];

        foreach (array_filter($this->languageService->loadLanguages(), $filter) as $language) {
            $languagesByCode[$language->languageCode] = $language;
        }

        $saLanguages = [];

        foreach ($this->siteAccessLanguages as $languageCode) {
            if (!isset($languagesByCode[$languageCode])) {
                continue;
            }

            $saLanguages[] = $languagesByCode[$languageCode];
            unset($languagesByCode[$languageCode]);
        }

        return array_merge($saLanguages, array_values($languagesByCode));
    }
public function loadContentLanguages(Content $content): array
    {
        $contentLanguages = $content->versionInfo->languageCodes;

        $filter = function (Language $language) use ($contentLanguages) {
            return $language->enabled && in_array($language->languageCode, $contentLanguages, true);
        };

        $languagesByCode = [];

        foreach (array_filter($this->languageService->loadLanguages(), $filter) as $language) {
            $languagesByCode[$language->languageCode] = $language;
        }

        $saLanguages = [];

        foreach ($this->siteAccessLanguages as $languageCode) {
            if (!isset($languagesByCode[$languageCode])) {
                continue;
            }

            $saLanguages[] = $languagesByCode[$languageCode];
            unset($languagesByCode[$languageCode]);
        }

        return array_merge($saLanguages, array_values($languagesByCode));
    }
public function loadContentLanguages ( Content $ content ) : array { $ contentLanguages = $ content -> versionInfo -> languageCodes ; $ filter = function ( Language $ language ) use ( $ contentLanguages ) { return $ language -> enabled && in_array ( $ language -> languageCode , $ contentLanguages , true ) ; } ; $ languagesByCode = [ ] ; foreach ( array_filter ( $ this -> languageService -> loadLanguages ( ) , $ filter ) as $ language ) { $ languagesByCode [ $ language -> languageCode ] = $ language ; } $ saLanguages = [ ] ; foreach ( $ this -> siteAccessLanguages as $ languageCode ) { if ( ! isset ( $ languagesByCode [ $ languageCode ] ) ) { continue ; } $ saLanguages [ ] = $ languagesByCode [ $ languageCode ] ; unset ( $ languagesByCode [ $ languageCode ] ) ; } return array_merge ( $ saLanguages , array_values ( $ languagesByCode ) ) ; }
Loads system languages with filtering applied.

@param \eZ\Publish\API\Repository\Values\Content\Content $content

@return array
Loads system languages with filtering applied .