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

namespace Kufer\Web\KuferTools\Basis\DozentenInfo\DozentDetails;

abstract class DozentDetailsController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  private $newDnr;
  private $newGuid;
  private $newDozStatusMsg;

  
  public function __construct($pNewDnr = null, $pNewGuid = null, $pNewDozStatusMsg = null)
  {
    $this->newDnr = $pNewDnr;
    $this->newGuid = $pNewGuid;
    $this->newDozStatusMsg = $pNewDozStatusMsg;
  }

  protected function getRequestObj()
  {
    $request = new DozentDetailsRequest();
    $request->dnr = \GetOperations::isDefined('dnr') ? \GetOperations::getVarValue('dnr') : $this->newDnr;
    $request->dguid = \GetOperations::isDefined('dguid') ? \GetOperations::getVarValue('dguid') : ($this->newGuid ?? '');
    $request->referer = \GetOperations::getVarValue('referer');
    $request->refererLabel = \GetOperations::getVarValue('refererLabel');
    $request->statusMessageContainer = null;
    $request->newDozStatusCode = \SessionOperations::getVarValueWTIntern('newDozStatusCode');
    $request->newDozWrongFields = \SessionOperations::getVarValueWTIntern('newDozWrongFields');

    return $request;
  }
}