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

namespace Kufer\Web\KuferTools\Firma\Anmeldung\AnmeldeFormular;

class AnmeldeFormularController extends \Kufer\Web\KuferTools\Basis\Controller\ToolController
{
  private $anmeldeStatus;

  public function __construct($pAnmeldeStatus = null)
  {
    $this->anmeldeStatus = $pAnmeldeStatus;
  }

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

  protected function getRequestObj()
  {
    $request = new AnmeldeFormularRequest();
    $request->knr = \GetOperations::getVarValue('knr');
    $request->anmeldeStatus = $this->anmeldeStatus;

    $request->referer = \GetOperations::getVarValue('referer');
    $request->refererLabel = \GetOperations::getVarValue('refererLabel');

    return $request;
  }

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