Inheritance: implements eZ\Publish\Core\MVC\Symfony\Locale\LocaleConverterInterface
 /**
  * @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));
 }
 /**
  * Returns current language.
  *
  * @return string
  */
 protected function getCurrentLanguage()
 {
     $request = $this->requestStack->getCurrentRequest();
     return $this->localeConverter->convertToEz($request->get('_locale'));
 }
 /**
  * Add an anonymous comment
  *
  * @param $connection
  * @param Request $request
  * @param LocaleConverter $localeService
  * @param array $data
  * @param $contentId
  * @param null $sessionId
  */
 public function addAnonymousComment($connection, Request $request, LocaleConverter $localeService, array $data, $contentId, $sessionId = null)
 {
     $this->checkConnection($connection);
     $languageCode = $localeService->convertToEz($request->getLocale());
     $languageId = $this->getLanguageId($connection, $languageCode);
     $created = $modified = \Time();
     $userId = self::ANONYMOUS_USER;
     $sessionKey = $sessionId;
     $ip = $request->getClientIp();
     $parentCommentId = 0;
     $name = $data[$this->translator->trans('name')];
     $email = $data[$this->translator->trans('email')];
     $url = "";
     $text = $data[$this->translator->trans('message')];
     $status = $this->hasModeration() ? self::COMMENT_WAITING : self::COMMENT_ACCEPT;
     $title = "";
     $selectQuery = $connection->createInsertQuery();
     $selectQuery->insertInto('ezcomment')->set('language_id', $selectQuery->bindValue($languageId))->set('created', $selectQuery->bindValue($created))->set('modified', $selectQuery->bindValue($modified))->set('user_id', $selectQuery->bindValue($userId))->set('session_key', $selectQuery->bindValue($sessionKey))->set('ip', $selectQuery->bindValue($ip))->set('contentobject_id', $selectQuery->bindValue($contentId))->set('parent_comment_id', $selectQuery->bindValue($parentCommentId))->set('name', $selectQuery->bindValue($name))->set('email', $selectQuery->bindValue($email))->set('url', $selectQuery->bindValue($url))->set('text', $selectQuery->bindValue($text))->set('status', $selectQuery->bindValue($status))->set('title', $selectQuery->bindValue($title));
     $statement = $selectQuery->prepare();
     $statement->execute();
     return $connection->lastInsertId();
 }
 /**
  * Get PosixLocale
  *
  * @param string $eZLocale
  *
  * @return null|string
  */
 public function getPosixLocale($eZLocale)
 {
     return $this->localeConverter->convertToPOSIX($eZLocale);
 }