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

namespace Kufer\KuferTools\Basis\DozentenInfo\DozentDetails;

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