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

namespace Kufer\Web\KuferTools\Basis\Kursdetails\Detailsreiter\Downloads;

abstract class DownloadsController extends \Kufer\Web\KuferTools\Basis\Controller\AjaxNoContainerToolController
{
  
  protected $statusMessageContainer;

  public function __construct($pStatusMessageContainer = null)
  {
    $this->statusMessageContainer = $pStatusMessageContainer;
  }

  protected function createNewRequestObj(): DownloadsRequest
  {
    return new DownloadsRequest();
  }

  protected function getRequestObj()
  {
    $requestObj = $this->createNewRequestObj();
    $requestObj->knr = \GetOperations::getVarValue('knr');
    
    $requestObj->statusMessageContainer = $this->statusMessageContainer;

    return $requestObj;
  }

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