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

namespace Kufer\KuferTools\Basis\AnwesenheitenKurs;

abstract class AnwSpeichernController extends \Kufer\KuferTools\Basis\Controller\ToolController
{
  protected function getRequestObj()
  {
    $requestObj = new AnwSpeichernRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');
    $requestObj->belKtInfos = \JsonOperations::getFromStringBase64(\PostOperations::getVarValue('BelKtInfos'));

    return $this->handleXsrf($requestObj, 'kurs_anw_aendern', $requestObj->knr);
  }

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

  abstract protected function getToolId();
}