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

namespace Kufer\KuferTools\Dozent\KursUebersicht\Ics;

class IcsKalenderController extends \Kufer\KuferTools\Basis\Ics\IcsKalenderController
{
  protected function getUseCase(): \Kufer\KuferTools\Basis\UseCase\UseCase
  {
    return new IcsKalenderUseCase(
      $this->getRequestObj()
    );
  }

  protected function getRequestObj()
  {
    $requestObj = parent::getRequestObj();
    $requestObj->vondat = \DateTimeOperations::getValidDateString(\PostOperations::getVarValue('terminvon', ''));
    $requestObj->bisdat = \DateTimeOperations::getValidDateString(\PostOperations::getVarValue('terminbis', ''));
    $requestObj->auchTermineAndererDozenten = \PostOperations::getVarValue('auchtermineanderer', false);

    return $requestObj;
  }
}