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

namespace Kufer\KuferTools\Teilnehmer\BayerischerApothekertagStudenten\SaveAnmeldeFormular;

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

  protected function getRequestObj()
  {
    $wssHandler = new \Kufer\KuferTools\Utils\WssHandler(SaveAnmeldeFormularUseCase::getToolSectionId(), SaveAnmeldeFormularUseCase::getUser());
    $requestObj = new SaveAnmeldeFormularRequest();
    $requestObj->columnValues = $wssHandler->getColumnValuesFromPost();
    $requestObj->wssHandler = $wssHandler;

    $action = $this->getActionVal();

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

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