<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Veranstalter\LeiterMitarbeiterAndererVeranstalter\SammelEMail;

class SendSammelEMailController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected function getRequestObj()
  {
    $requestObj = new \Kufer\Web\KuferTools\Basis\DozentenInfo\SammelEMail\SendSammelEMailRequest();
    $requestObj->emailBetreff = \PostOperations::getVarValue('email_betreff');
    $requestObj->emailBody = \PostOperations::getVarValue('email_body');

    
    $action = \GetOperations::getVarValue('action');
    $requestObj = $this->handleXsrf($requestObj, $action);

    
    $requestObj->dozNummern = \PostOperations::getVarValue('dozenten', array());
    $requestObj->anhangTnList = \PostOperations::isDefined('anhangTnList');

    return $requestObj;
  }

  protected function getPresenter($pUseCaseResponse)
  {
    return new SendSammelEMailPresenter($pUseCaseResponse);
  }

  protected function getUseCase(): \Kufer\Web\KuferTools\Basis\UseCase\UseCase
  {
    return new SendSammelEMailUseCase(
      $this->getRequestObj()
    );
  }
}