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

namespace Kufer\Web\KuferTools\Veranstalter\KursUebersicht\Ics;

class IcsKalenderController extends \Kufer\Web\KuferTools\Basis\Ics\IcsKalenderController
{
  protected function getUseCase(): \Kufer\Web\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;
  }
}