<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Dozent\KursBewerbung\BewerbungsFormular;

class BewerbungAbsendenController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  
  protected function getUseCase(): \Kufer\Web\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\Web\KuferTools\Utils\WssHandler(
      BewerbungAbsendenUseCase::getToolId(),
      BewerbungAbsendenUseCase::getToolSectionId(),
      BewerbungAbsendenUseCase::getUser()
    );
    $requestObj->columnValues = $wssHandler->getColumnValuesFromPost();
    $requestObj->wssHandler = $wssHandler;

    return $requestObj;
  }

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