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

namespace Kufer\KuferTools\Basis\Uebersicht;

abstract class UebersichtController extends \Kufer\KuferTools\Basis\Controller\ToolController
{
  protected function getRequestObj()
  {
    $requestObj = $this->getDefaultRequestObj();
    $requestObj->seite = \GetOperations::getVarValue('seite');
    $requestObj->einstieg = \GetOperations::isDefined('einstieg');
    $requestObj->aendereFilter = false;
    $toolId = $this->getToolId();

    if ($requestObj->einstieg) {
      
      

      $suchApi = $this->getSuchAPI();
      if (!is_null($suchApi)) {
        if ($suchApi instanceof \Kufer\Web\KuferTools\Utils\FilterSearch\ISearchFilter) {
          $requestObj->suchParameter = $suchApi->getSearchMapEmptyValues();
        } else {
          $requestObj->suchParameter = $suchApi->getSearchParamsFromReq('tool' . $toolId, $this->getRequestSearchName());
        }
      }
    }

    $requestObj->markieren = \Kufer\KuferTools\Basis\Markieren\Markieren::getMarkierenFromRequest($toolId, $this->getMarkierenVarName(), $this->getSelectionMarkierenVarname());

    return $requestObj;
  }

  
  protected function getMarkierenVarName(): string
  {
    return 'totaldatastr_';
  }

  protected function getSelectionMarkierenVarname(): string
  {
    return 'selnrstr_';
  }

  
  abstract protected function getToolId();

  
  abstract protected function getDefaultRequestObj();

  
  abstract protected function getSuchAPI();

  
  abstract protected function getRequestSearchName();
}