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

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

use Kufer\Web\KuferTools\Utils\FilterSearch\WunschtermineSearchFilter;

class WunschtermineSetFilterController extends WunschtermineController
{
  protected function getRequestObj()
  {
    $requestObj = parent::getRequestObj();
    if (!$this->isBrowserRefresh()) {
      $requestObj->suchParameter = $this->getFilterFromPost();
      $requestObj->aendereFilter = true;
    }

    return $requestObj;
  }

  protected function getFilterFromPost()
  {
    $searchFilter = new WunschtermineSearchFilter();

    return $searchFilter->getSearchMapFromRequest();
  }

  private function isBrowserRefresh()
  {
    
    return !\RequestOperations::isDefined('wunschtermineDatumVon');
  }
}