<?php
/**
 * @copyright (c) Kufer Software GmbH, Oderstraße 7, D-84453 Mühldorf
 */

namespace Kufer\Web\KuferTools\Basis\KursDetails\Feedback;

abstract class SendFeedbackController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  protected function getNewRequestObj()
  {
    return new SendFeedbackRequest();
  }

  protected function getRequestObj()
  {
    $requestObj = $this->getNewRequestObj();
    $requestObj->nachricht_betreff = $this->getFeedbackSubject();
    $requestObj->nachricht_body = $this->getFeedbackMessage();

    $requestObj->uploadFiles = \UploadOperations::getAttachments('anhang');

    return $requestObj;
  }

  protected function getFeedbackSubject(): string
  {
    return \PostOperations::getVarValue('feedback_betreff');
  }

  protected function getFeedbackMessage(): string
  {
    return \PostOperations::getVarValue('feedback_body');
  }

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