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

namespace Kufer\KuferTools\Basis\KursDetails\KursausfallSetzen;

abstract class KursausfallSetzenAbsendenController extends \Kufer\KuferTools\Basis\Controller\ToolController
{
  protected function getRequestObj()
  {
    $requestObj = new KursausfallSetzenAbsendenRequest();
    $requestObj->knr = \RequestOperations::getVarValue('knr');
    $requestObj->raumFreigeben = \RequestOperations::isDefined('raum_freigeben');
    $requestObj->ktLoeschen = \RequestOperations::getVarValue('kt_loeschen_radio', null);
    $requestObj->ausfallgrund = trim(\RequestOperations::getVarValue('ausfallgrund'));
    $requestObj->medienLoeschen = \RequestOperations::isDefined('medien_loeschen');
    $requestObj->benachrichtigungTn = \RequestOperations::isDefined('benachrichtigung_tn');

    $action = $this->getActionVal();

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

  protected function getPresenter($pUseCaseResponse)
  {
    return null;
  }

  protected function getAccessDeniedController()
  {
    return new \Kufer\KuferTools\Oeffentlich\AccessDenied\OhneContainer\AccessDeniedOhneContainerController();
  }
}