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

namespace Kufer\Web\KuferTools\Basis\Anmeldung\KursUebersicht\HandleAnmeldung;

abstract class HandleAnmeldungController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected function createBasicRequestObj(): HandleAnmeldungRequest
  {
    return new HandleAnmeldungRequest();
  }

  protected function getRequestObj()
  {
    $requestObj = $this->createBasicRequestObj();
    $requestObj->knr = \RequestOperations::getVarValue('knr');
    $requestObj->zahlart = \PostOperations::getVarValue('anm_zahlart');
    $requestObj->abwBankverbindungAngegeben = \PostOperations::isDefined('abw_iban');
    $requestObj->abw_isNurFuerAnmeldung = \PostOperations::getVarValue('abw_isNurFuerAnmeldung', false) === 'true';
    $requestObj->abw_verfahren = \PostOperations::getVarValue('abw_verfahren');
    $requestObj->abw_inhaber = \PostOperations::getVarValue('abw_inhaber');
    $requestObj->abw_bank = \PostOperations::getVarValue('abw_bank');
    $requestObj->abw_kto = \PostOperations::getVarValue('abw_kto');
    $requestObj->abw_kto = \PostOperations::getVarValue('abw_kto');
    $requestObj->abw_blz = \PostOperations::getVarValue('abw_blz');
    $requestObj->abw_bic = \PostOperations::getVarValue('abw_bic');
    $requestObj->abw_iban = \PostOperations::getVarValue('abw_iban');

    $action = $this->getActionVal();

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