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

namespace Kufer\KuferTools\Teilnehmer\Kursvorschlag;

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

  protected function getRequestObj()
  {
    $requestObj = new SendKursvorschlagRequest();
    $requestObj->kursthema = \PostOperations::getVarValue('kursthema');
    $requestObj->kursinhalt = \PostOperations::getVarValue('kursinhalt');
    $requestObj->bemerkungen = \PostOperations::getVarValue('bemerkungen');
    $requestObj->kursdauer = \PostOperations::getVarValue('kursdauer');
    $requestObj->dauerForm = \PostOperations::getVarValue('dauerForm');
    $requestObj->uhrzeit = \PostOperations::getVarValue('uhrzeit');
    $requestObj->tageszeit = \PostOperations::getVarValue('tageszeit');

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

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

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