public function getPrioritizedLanguages(?array $forcedLanguages): array
    {
        // Skip if languages param has been set by API user
        if ($forcedLanguages !== null) {
            return $forcedLanguages;
        }

        // Detect if we should load all languages by default
        if ($this->defaultShowAllTranslations) {
            return Language::ALL;
        }

        // create language based on context and configuration, where context language is made most important one
        $languages = [];
        if ($this->contextLanguage !== null) {
            $languages[] = $this->contextLanguage;
        }

        return array_values(array_unique(array_merge($languages, $this->configLanguages)));
    }
public function getPrioritizedLanguages(?array $forcedLanguages): array
    {
        // Skip if languages param has been set by API user
        if ($forcedLanguages !== null) {
            return $forcedLanguages;
        }

        // Detect if we should load all languages by default
        if ($this->defaultShowAllTranslations) {
            return Language::ALL;
        }

        // create language based on context and configuration, where context language is made most important one
        $languages = [];
        if ($this->contextLanguage !== null) {
            $languages[] = $this->contextLanguage;
        }

        return array_values(array_unique(array_merge($languages, $this->configLanguages)));
    }
public function getPrioritizedLanguages ( ? array $ forcedLanguages ) : array { // Skip if languages param has been set by API user if ( $ forcedLanguages !== null ) { return $ forcedLanguages ; } // Detect if we should load all languages by default if ( $ this -> defaultShowAllTranslations ) { return Language :: ALL ; } // create language based on context and configuration, where context language is made most important one $ languages = [ ] ; if ( $ this -> contextLanguage !== null ) { $ languages [ ] = $ this -> contextLanguage ; } return array_values ( array_unique ( array_merge ( $ languages , $ this -> configLanguages ) ) ) ; }
Get prioritized languages taking into account forced-, context- and lastly configured-languages.

@param array|null $forcedLanguages Optional, typically arguments provided to API, will be used first if set.

@return array
Get prioritized languages taking into account forced - context - and lastly configured - languages .