public function getLanguagesWithMasterLanguagePromoted()
    {
        $languages = $this
            ->languageManager
            ->getLanguages()
            ->toArray();

        $masterLocale = $this
            ->masterLocale
            ->getIso();

        $index = array_search($masterLocale, $languages);

        if (false !== $index) {
            $mainLanguage = $languages[$index];
            unset($languages[$index]);
            array_unshift($languages, $mainLanguage);
        }

        return new ArrayCollection($languages);
    }
public function getLanguagesWithMasterLanguagePromoted()
    {
        $languages = $this
            ->languageManager
            ->getLanguages()
            ->toArray();

        $masterLocale = $this
            ->masterLocale
            ->getIso();

        $index = array_search($masterLocale, $languages);

        if (false !== $index) {
            $mainLanguage = $languages[$index];
            unset($languages[$index]);
            array_unshift($languages, $mainLanguage);
        }

        return new ArrayCollection($languages);
    }
public function getLanguagesWithMasterLanguagePromoted ( ) { $ languages = $ this -> languageManager -> getLanguages ( ) -> toArray ( ) ; $ masterLocale = $ this -> masterLocale -> getIso ( ) ; $ index = array_search ( $ masterLocale , $ languages ) ; if ( false !== $ index ) { $ mainLanguage = $ languages [ $ index ] ; unset ( $ languages [ $ index ] ) ; array_unshift ( $ languages , $ mainLanguage ) ; } return new ArrayCollection ( $ languages ) ; }
Return all languages with the master one promoted to the first position.

@return Collection Languages collection
Return all languages with the master one promoted to the first position .