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

namespace Kufer\KuferTools\Dozent\KursBewerbung\BewerbungsFormular;

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

  
  protected function getRequestObj()
  {
    $requestObj = new BewerbungAbsendenRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');

    $requestObj = $this->handleXsrf($requestObj, 'dozbewerbung', $requestObj->knr);

    $wssHandler = new \Kufer\KuferTools\Utils\WssHandler(BewerbungAbsendenUseCase::getToolSectionId(), BewerbungAbsendenUseCase::getUser());
    $requestObj->columnValues = $wssHandler->getColumnValuesFromPost();
    $requestObj->wssHandler = $wssHandler;

    return $requestObj;
  }

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