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

namespace Kufer\Web\KuferTools\Basis\Anmeldung\AnmeldeFormular;

abstract class AnmeldeFormularController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected $anmeldeStatus;

  public function __construct($pAnmeldeStatus = null)
  {
    $this->anmeldeStatus = $pAnmeldeStatus;
  }

  protected function getRequestObj()
  {
    $request = new AnmeldeFormularRequest();
    $request->einstieg = \GetOperations::isDefined('einstieg');
    $request->action = \PostOperations::getVarValue('action');
    $request->knr = \GetOperations::getVarValue('knr');
    $request->tnr = \GetOperations::getVarValue('tnr');
    $request->tguid = \GetOperations::getVarValue('tguid', null);
    $request->anmeldeStatus = $this->anmeldeStatus;
    $request->keepCurrentTnr = \PostOperations::getVarValue('keepCurrentTnr', false);

    return $request;
  }
}