eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverter::convertToEz PHP Метод

convertToEz() публичный Метод

Returns null if conversion cannot be made.
public convertToEz ( string $posixLocale ) : string | null
$posixLocale string
Результат string | null
    public function convertToEz($posixLocale)
    {
        if (!isset($this->reverseConversionMap[$posixLocale])) {
            $this->logger->warning("Could not convert locale '{$posixLocale}' to eZ Publish format. Please check your locale configuration in ezpublish.yml");
            return;
        }
        return $this->reverseConversionMap[$posixLocale];
    }

Usage Example

Пример #1
0
 /**
  * @dataProvider convertToEzProvider
  *
  * @covers eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverter::convertToEz
  *
  * @param $posixLocale
  * @param $expected
  */
 public function testConvertToEz($posixLocale, $expected)
 {
     if ($expected === null) {
         $this->logger->expects($this->once())->method('warning');
     }
     $this->assertSame($expected, $this->localeConverter->convertToEz($posixLocale));
 }
All Usage Examples Of eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverter::convertToEz