/** * Odchytí výjimku, v případě, že je program v produkčním modu, je výjimka zalogována a komponentě předána Flash * Message. Pokud ne, je vyhozena dál. * @param \Exception $exception * @param BaseControl $component * @param string $message * @throws \Exception */ protected function catchException(\Exception $exception, BaseControl $component, $message = "global.errors.action-error") { if (\Tracy\Debugger::$productionMode) { \Tracy\Debugger::log($exception->getMessage(), \Tracy\Logger::EXCEPTION); $component->flashMessage($this->t($message), "danger"); } else { throw $exception; } }
/** * ForgotPassword constructor. * @param \Model\Common\Mailer $mailer * @param \Model\Core\ActionKey\Repository $actionKeyRepository * @param \Model\Core\User\Repository $userRepository * @param \Kdyby\Translation\Translator $translator * @param \Model\Core\DbUtils $dbUtils */ public function __construct(\Model\Common\Mailer $mailer, \Model\Core\ActionKey\Repository $actionKeyRepository, \Model\Core\User\Repository $userRepository, \Kdyby\Translation\Translator $translator, \Model\Core\DbUtils $dbUtils) { parent::__construct($translator, $dbUtils); $this->userRepository = $userRepository; $this->actionKeyRepository = $actionKeyRepository; $this->mailer = $mailer; }