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

namespace Kufer\KuferTools\Mitarbeiter\AdressInfo\AdressUebersicht;

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

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

    return $requestObj;
  }

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

    return $searchFilter->getSearchMapFromRequest();
  }

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