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

namespace Kufer\Web\KuferTools\Basis\NachlassDialog;

abstract class NachlassDialogAnmeldungUseCase extends \Kufer\Web\KuferTools\Basis\UseCase\EinzelKursUseCase
{
  public function __construct($request)
  {
    parent::__construct($request, new NachlassDialogResponse());
  }

  public function hasAccess($pToolsectionId = null)
  {
    if (!parent::hasAccess($pToolsectionId)) {
      return false;
    }

    return true;
  }

  abstract protected function getFormularAction();

  public function action()
  {
    return $this->getResponse();
  }

  protected function getResponse()
  {
    $hlAnmBemerkung = new \HinterlegungAnmBemerkung();
    $hlAnmBemerkung->fields = array('grund');
    $this->response->hlbemerkung = $hlAnmBemerkung;
    $this->response->action = $this->getFormularAction();
    $this->response->belegung = new \Belegung();
    $this->response->isKind = false;

    return $this->response;
  }
}