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

Public Member Functions | Private Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider Class Reference
Inheritance diagram for eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider:

## Public Member Functions
| __construct (RequestStack $requestStack, UserPreferenceService $userPreferenceService, array $languageCodesMap, string $localeFallback)
| getPreferredLocales (Request $request=null)
| Return a list of user's browser preferred locales directly from Accept-Language header. More...
| getPreferredLanguages ()
| List of eZ Language codes. More...

## Private Attributes
| $requestStack
| $userPreferenceService
| $languageCodesMap
| $localeFallback

## Detailed Description

Definition at line 16 of file UserLanguagePreferenceProvider.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::__construct | ( | RequestStack | $requestStack,
|  | UserPreferenceService | $userPreferenceService,
|  | array | $languageCodesMap,
|  | string | $localeFallback
| ) |  |

Parameters

  \Symfony\Component\HttpFoundation\RequestStack | $requestStack |
  \eZ\Publish\API\Repository\UserPreferenceService | $userPreferenceService |
  array | $languageCodesMap |
  string | $localeFallback |

Definition at line 36 of file UserLanguagePreferenceProvider.php.

References eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\$languageCodesMap, eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\$localeFallback, eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\$requestStack, and eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\$userPreferenceService.

## Member Function Documentation

## ◆ getPreferredLanguages()

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::getPreferredLanguages | ( |  | ) |

List of eZ Language codes.

Returns
  string[]

Implements eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface.

Definition at line 69 of file UserLanguagePreferenceProvider.php.

References eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\getPreferredLocales().

## ◆ getPreferredLocales()

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::getPreferredLocales | ( | Request | $request = `null` | ) |

Return a list of user's browser preferred locales directly from Accept-Language header.

Parameters

Implements eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProviderInterface.

Definition at line 48 of file UserLanguagePreferenceProvider.php.

References eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\$localeFallback.

Referenced by eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\getPreferredLanguages().

## Member Data Documentation

## ◆ $languageCodesMap

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::$languageCodesMap
| private

Definition at line 25 of file UserLanguagePreferenceProvider.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\__construct().

## ◆ $localeFallback

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::$localeFallback
| private

Definition at line 28 of file UserLanguagePreferenceProvider.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\__construct(), and eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\getPreferredLocales().

## ◆ $requestStack

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::$requestStack
| private

Definition at line 19 of file UserLanguagePreferenceProvider.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\__construct().

## ◆ $userPreferenceService

eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider::$userPreferenceService
| private

Definition at line 22 of file UserLanguagePreferenceProvider.php.

Referenced by eZ\Publish\Core\MVC\Symfony\Locale\UserLanguagePreferenceProvider\__construct().

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

- UserLanguagePreferenceProvider.php

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