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

namespace Kufer\KuferTools\Veranstalter\Anmeldung\HandleSaveSettingsAjax;

class HandleSaveSettingsAjaxController extends \Kufer\KuferTools\Basis\Controller\AjaxToolController
{
  protected function getUseCase(): \Kufer\KuferTools\Basis\UseCase\UseCase
  {
    return new HandleSaveSettingsAjaxUseCase(
      $this->getRequestObj()
    );
  }

  protected function getRequestObj()
  {
    $requestObj = new HandleSaveSettingsAjaxRequest();
    $requestObj->savesettings = \GetOperations::isDefined('savesettings');
    $requestObj->ausgewaehlteOptionen = \PostOperations::getVarValue('ausgewaehlteOptionen');

    return $requestObj;
  }

  protected function getPresenter($pUseCaseResponse)
  {
    return new HandleSaveSettingsAjaxPresenter($pUseCaseResponse);
  }
}