You are here

public function LoggingTranslator::__construct in Plug 7

Parameters

TranslatorInterface $translator The translator must implement TranslatorBagInterface:

LoggerInterface $logger:

File

lib/Symfony/translation/LoggingTranslator.php, line 35

Class

LoggingTranslator
@author Abdellatif Ait boudad <a.aitboudad@gmail.com>

Namespace

Symfony\Component\Translation

Code

public function __construct(TranslatorInterface $translator, LoggerInterface $logger) {
  if (!$translator instanceof TranslatorBagInterface) {
    throw new \InvalidArgumentException(sprintf('The Translator "%s" must implement TranslatorInterface and TranslatorBagInterface.', get_class($translator)));
  }
  $this->translator = $translator;
  $this->logger = $logger;
}