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

namespace Kufer\Web\KuferTools\Dozent\SammelVertraege\Drucken;

use Kufer\Web\KuferTools\Dozent\SammelVertraege\SammelVertraegeController;

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

  protected function getRequestObj()
  {
    $request = new SammelVertragDruckenRequest();
    $request->id = \GetOperations::getVarValue('id');

    $action = $this->getActionVal();
    $request->isXsrfOk = $this->isXsrfOk($action, $request->id);

    return $request;
  }

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

  protected function getControllerToForward($pUseCaseResponse)
  {
    if (!$pUseCaseResponse->success) {
      return new SammelVertraegeController();
    }

    return null;
  }
}