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

namespace Kufer\KuferTools\Basis\KursDetails\Feedback;

abstract class SendFeedbackController extends \Kufer\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);
  }
}