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

namespace Kufer\KuferTools\Dozent\Lehrplan\PrintGrafikListenLehrplan;

class PrintGrafikListenLehrplanController extends \Kufer\KuferTools\Dozent\KursUebersicht\PdfListen\GrafikListen\PrintGrafikListen\PrintGrafikListenController
{
  protected function getUseCase(): \Kufer\KuferTools\Basis\UseCase\UseCase
  {
    return new PrintGrafikListenLehrplanUseCase(
      $this->getRequestObj()
    );
  }

  protected function getRequestObj()
  {
    $user = PrintGrafikListenLehrplanUseCase::getUser();
    $requestObj = new PrintDruckListenLehrplanRequest();
    $requestObj->id = \GetOperations::getVarValue('nr');
    $requestObj->listName = \GetOperations::getVarValue('liste', '');
    $requestObj->dnr = \RequestOperations::getVarValue('dnr', (isset($user) ? $user->dnr : -1));
    $requestObj->ktVon = \GetOperations::getVarValue('kt_von');
    $requestObj->ktBis = \GetOperations::getVarValue('kt_bis');
    $requestObj->ktZeitvon = \GetOperations::getVarValue('zeit_von');
    $requestObj->ktZeitbis = \GetOperations::getVarValue('zeit_bis');

    return $requestObj;
  }
}