<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Teilnehmer\KursUebersicht\Detailsreiter\InfoAnDoz;

class SendInfoAnDozController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected function getUseCase(): \Kufer\Web\KuferTools\Basis\UseCase\UseCase
  {
    return new SendInfoAnDozUseCase($this->getRequestObj());
  }

  protected function getRequestObj()
  {
    $requestObj = new SendInfoAnDozRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');
    $requestObj->dozentenIds = \PostOperations::getVarValue('dozenten', array());
    $requestObj->emailBetreff = \PostOperations::getVarValue('email_betreff');
    $requestObj->emailBody = \PostOperations::getVarValue('email_body');
    $requestObj->belegId = \GetOperations::getVarValue('belid');

    
    $action = \GetOperations::getVarValue('action');

    return $this->handleXsrf($requestObj, $action, $requestObj->knr);
  }

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