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

namespace Kufer\KuferTools\Veranstalter\KursUebersicht\Detailsreiter\Termine\SmsKursort;

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

  protected function getRequestObj()
  {
    $requestObj = new SendSmsKursortRequest();
    $requestObj->knr = \GetOperations::getVarValue('knr');
    $requestObj->kursTagId = \GetOperations::getVarValue('kurstag_id');
    $requestObj->smsBody = \PostOperations::getVarValue('sms_body');

    
    $action = \GetOperations::getVarValue('action');

    return $this->handleXsrf($requestObj, $action, $requestObj->kursTagId);
  }

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