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

namespace Kufer\Web\KuferTools\Dozent\Lehrplan\PrintGrafikListenLehrplan;

class PrintGrafikListenLehrplanController extends \Kufer\Web\KuferTools\Dozent\KursUebersicht\PdfListen\GrafikListen\PrintGrafikListen\PrintGrafikListenController
{
  protected function getUseCase(): \Kufer\Web\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;
  }
}