Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator Class Reference

Language MaskGenerator. More...

## Public Member Functions
| __construct (LanguageHandler $languageHandler)
| Creates a new Language MaskGenerator. More...
| generateLanguageMask (array $languages)
| Generates a language mask from the keys of $languages. More...
| generateLanguageMaskFromLanguageIds (array $languageIds, $alwaysAvailable)
| Generates a language mask from pre-loaded Language Ids. More...
| generateLanguageIndicator ($languageCode, $alwaysAvailable)
| Generates a language indicator from $languageCode and $alwaysAvailable. More...
| isLanguageAlwaysAvailable ($language, array $languages)
| Checks if $language is always available in $languages;. More...
| isAlwaysAvailable ($languageMask)
| Checks if $languageMask contains the alwaysAvailable bit field. More...
| removeAlwaysAvailableFlag ($languageId)
| Removes the alwaysAvailable flag from $languageId and returns cleaned up $languageId. More...
| extractLanguageIdsFromMask ($languageMask)
| Extracts every language Ids contained in $languageMask. More...
| extractLanguageCodesFromMask ($languageMask)
| Extracts Language codes contained in given $languageMask. More...
| isLanguageMaskComposite ($languageMask)
| Checks if given $languageMask consists of multiple languages. More...
| generateLanguageMaskFromLanguageCodes (array $languageCodes, bool $isAlwaysAvailable=false)
| Generates a language mask from plain array of language codes and always available flag. More...

## Protected Attributes
| $languageHandler

## Detailed Description

Language MaskGenerator.

Definition at line 15 of file MaskGenerator.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::__construct | ( | LanguageHandler | $languageHandler | ) |

Creates a new Language MaskGenerator.

Parameters

  \eZ\Publish\SPI\Persistence\Content\Language\Handler | $languageHandler |

Definition at line 29 of file MaskGenerator.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator\$languageHandler.

## Member Function Documentation

## ◆ extractLanguageCodesFromMask()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::extractLanguageCodesFromMask | ( |  | $languageMask | ) |

Extracts Language codes contained in given $languageMask.

Parameters

  int | $languageMask |

Returns
  array

Definition at line 171 of file MaskGenerator.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator\extractLanguageIdsFromMask().

## ◆ extractLanguageIdsFromMask()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::extractLanguageIdsFromMask | ( |  | $languageMask | ) |

Extracts every language Ids contained in $languageMask.

Parameters

  int | $languageMask |

Returns
  array Array of language Id

Definition at line 147 of file MaskGenerator.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator\extractLanguageCodesFromMask().

## ◆ generateLanguageIndicator()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::generateLanguageIndicator | ( |  | $languageCode,
|  |  | $alwaysAvailable
| ) |  |

Generates a language indicator from $languageCode and $alwaysAvailable.

Parameters

  string | $languageCode |
  bool | $alwaysAvailable |

Returns
  int

Exceptions

Definition at line 96 of file MaskGenerator.php.

## ◆ generateLanguageMask()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::generateLanguageMask | ( | array | $languages | ) |

Generates a language mask from the keys of $languages.

Deprecated:
  Move towards using {

See also
  generateLanguageMaskFromLanguageCodes()} or the other generate* methods.

Exceptions

Definition at line 45 of file MaskGenerator.php.

## ◆ generateLanguageMaskFromLanguageCodes()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::generateLanguageMaskFromLanguageCodes | ( | array | $languageCodes,
|  | bool | $isAlwaysAvailable = `false`
| ) |  |

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

Exceptions

Definition at line 215 of file MaskGenerator.php.

## ◆ generateLanguageMaskFromLanguageIds()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::generateLanguageMaskFromLanguageIds | ( | array | $languageIds,
|  |  | $alwaysAvailable
| ) |  |

Generates a language mask from pre-loaded Language Ids.

Parameters

  int[] | $languageIds |
  bool | $alwaysAvailable |

Returns
  int

Definition at line 74 of file MaskGenerator.php.

## ◆ isAlwaysAvailable()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::isAlwaysAvailable | ( |  | $languageMask | ) |

Checks if $languageMask contains the alwaysAvailable bit field.

Parameters

  int | $languageMask |

Returns
  bool

Definition at line 123 of file MaskGenerator.php.

## ◆ isLanguageAlwaysAvailable()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::isLanguageAlwaysAvailable | ( |  | $language,
|  | array | $languages
| ) |  |

Checks if $language is always available in $languages;.

Parameters

  string | $language |
  array | $languages |

Returns
  bool

Definition at line 109 of file MaskGenerator.php.

## ◆ isLanguageMaskComposite()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::isLanguageMaskComposite | ( |  | $languageMask | ) |

Checks if given $languageMask consists of multiple languages.

Parameters

  int | $languageMask |

Returns
  bool

Definition at line 191 of file MaskGenerator.php.

References eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator\removeAlwaysAvailableFlag().

## ◆ removeAlwaysAvailableFlag()

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::removeAlwaysAvailableFlag | ( |  | $languageId | ) |

Removes the alwaysAvailable flag from $languageId and returns cleaned up $languageId.

Parameters

  int | $languageId |

Returns
  int

Definition at line 135 of file MaskGenerator.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator\isLanguageMaskComposite().

## Member Data Documentation

## ◆ $languageHandler

eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator::$languageHandler
| protected

Definition at line 22 of file MaskGenerator.php.

Referenced by eZ\Publish\Core\Persistence\Legacy\Content\Language\MaskGenerator\__construct().

The documentation for this class was generated from the following file:

- MaskGenerator.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.