eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface::convertToPOSIX PHP Method

convertToPOSIX() public method

Returns null if conversion cannot be made.
public convertToPOSIX ( string $ezpLocale ) : string | null
$ezpLocale string
return string | null
    public function convertToPOSIX($ezpLocale);

Usage Example

コード例 #1
0
 /**
  * Returns a hash with 'locale' as key and locale string in POSIX format as value.
  *
  * Locale from request object will be used as locale if set, otherwise field language code
  * will be converted to locale string.
  *
  * @param Field $field
  *
  * @return array
  */
 public function getViewParameters(Field $field)
 {
     $parameters = array();
     if ($this->request && $this->request->attributes->has('_locale')) {
         $parameters['locale'] = $this->request->attributes->get('_locale');
     } else {
         $parameters['locale'] = $this->localeConverter->convertToPOSIX($field->languageCode);
     }
     return $parameters;
 }
All Usage Examples Of eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface::convertToPOSIX
LocaleConverterInterface