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

namespace Kufer\KuferTools\Basis\Anmeldung\AnmeldeFormular;

abstract class AnmeldeFormularController extends \Kufer\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;
  }
}