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

namespace Kufer\Web\KuferTools\Dozent\Wunschtermine\Uebersicht\Filter;

use Kufer\KuferTools\Basis\UseCase\BasisResponse;
use Kufer\Web\KuferTools\Dozent\Wunschtermine\Uebersicht;
use webbasys\includee\datamenu\DataMenuKurseGroupALaIhk\AlternatMapHelper;

class WunschtermineShowFilterUseCase extends \Kufer\KuferTools\Basis\UseCase\ToolUseCase
{
  public function __construct($request)
  {
    parent::__construct($request, new WunschtermineShowFilterResponse());
  }

  public static function getToolId()
  {
    return Uebersicht\WunschtermineUseCase::getToolId();
  }

  public static function getToolSectionId()
  {
    return Uebersicht\WunschtermineUseCase::getToolSectionId();
  }

  public function action()
  {
    return $this->getResponse();
  }

  private function setFilterVals()
  {
    $searchAPI = new \Kufer\Web\KuferTools\Utils\FilterSearch\WunschtermineSearchFilter();
    $fromobject = $searchAPI->getSearchMapFromSession($this->getToolId());
    $this->response->datumVon = $fromobject['DatumVon'];
    $this->response->datumBis = $fromobject['DatumBis'];
    $this->response->zeitVon = $fromobject['ZeitVon'];
    $this->response->zeitBis = $fromobject['ZeitBis'];
    $this->response->bemerkung = $fromobject['Bemerkung'];
    $this->response->toolId = $this->getToolId();
  }

  protected function getResponse()
  {
    $this->setFilterVals();

    return $this->response;
  }
}

class WunschtermineShowFilterRequest
{
}

class WunschtermineShowFilterResponse extends BasisResponse
{
  public $toolId;
  public $datumVon;
  public $datumBis;
  public $zeitVon;
  public $zeitBis;
  public $bemerkung;
}