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


namespace Kufer\KuferTools\Mitarbeiter\KursUebersicht\Detailsreiter\Downloads\BearbeiteDoku;

use Kufer\KuferTools\Utils\Download\DokuHelper as DokuHelper;

class BearbeiteDokuSubmitController extends \Kufer\KuferTools\Basis\Controller\ToolController
{
  
  private $dokuHelper;

  public function __construct()
  {
    $this->dokuHelper = new DokuHelper();
  }

  protected function getUseCase(): \Kufer\KuferTools\Basis\UseCase\UseCase
  {
    return new BearbeiteDokuSubmitUseCase(
      $this->getRequestObj(),
      $this->dokuHelper
    );
  }

  protected function getRequestObj()
  {
    $requestObj = $this->dokuHelper->getCommonRequestPart();
    $requestObj->knr = \RequestOperations::getVarValue('knr');
    $requestObj->dokuId = \RequestOperations::getVarValue('dokumentId');

    
    $action = \GetOperations::getVarValue('action');
    
    return $this->handleXsrf($requestObj, $action, $requestObj->dokuId);
  }

  protected function getPresenter($pUseCaseResponse)
  {
    
    return null;
  }

  
  protected function getControllerToForward($pUseCaseResponse)
  {
    
    $statusMessageContainer = $pUseCaseResponse->statusMessageContainer;

    return new \Kufer\KuferTools\Mitarbeiter\KursUebersicht\KursDetails\KursDetailsExternController($statusMessageContainer);

    
    
    
  }
}