public function generateLanguageMaskFromLanguageCodes(array $languageCodes, bool $isAlwaysAvailable = false): int
    {
        $mask = $isAlwaysAvailable ? 1 : 0;

        $languageList = $this->languageHandler->loadListByLanguageCodes($languageCodes);
        foreach ($languageList as $language) {
            $mask |= $language->id;
        }

        if ($missing = array_diff($languageCodes, array_keys($languageList))) {
            throw new NotFoundException('Language', implode(', ', $missing));
        }

        return $mask;
    }
public function generateLanguageMaskFromLanguageCodes(array $languageCodes, bool $isAlwaysAvailable = false): int
    {
        $mask = $isAlwaysAvailable ? 1 : 0;

        $languageList = $this->languageHandler->loadListByLanguageCodes($languageCodes);
        foreach ($languageList as $language) {
            $mask |= $language->id;
        }

        if ($missing = array_diff($languageCodes, array_keys($languageList))) {
            throw new NotFoundException('Language', implode(', ', $missing));
        }

        return $mask;
    }
public function generateLanguageMaskFromLanguageCodes ( array $ languageCodes , bool $ isAlwaysAvailable = false ) : int { $ mask = $ isAlwaysAvailable ? 1 : 0 ; $ languageList = $ this -> languageHandler -> loadListByLanguageCodes ( $ languageCodes ) ; foreach ( $ languageList as $ language ) { $ mask |= $ language -> id ; } if ( $ missing = array_diff ( $ languageCodes , array_keys ( $ languageList ) ) ) { throw new NotFoundException ( 'Language' , implode ( ', ' , $ missing ) ) ; } return $ mask ; }
Generates a language mask from plain array of language codes and always available flag.

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException If language(s) in $languageCodes was not be found

@param string[] $languageCodes
@param bool $isAlwaysAvailable

@return int
Generates a language mask from plain array of language codes and always available flag .