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

namespace Kufer\KuferTools\Mitarbeiter\KursUebersicht\Raumplanung;

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

  protected function getRequestObj()
  {
    $requestObj = new KurstageAnlegenRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');
    $requestObj->ktDatumAry = \PostOperations::getVarValue('kurstag_datum', array());

    $action = $this->getActionVal();

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

  protected function getControllerToForward($pUseCaseResponse)
  {
    return new \Kufer\KuferTools\Mitarbeiter\KursUebersicht\KursDetails\KursDetailsExternController(null, true);
  }

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