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

namespace Kufer\KuferTools\Dozent\Anwesenheiten\AnwesenheitenSpeichern;

use Kufer\Mail\EMail\IEMail;

class AnwesenheitenSpeichernAbweichendeUEEMailPresenter extends \Kufer\KuferTools\Basis\Presenter\Presenter implements IEMail
{
  
  private $view;

  
  private $viewModel;

  public function __construct($viewModel)
  {
    $this->viewModel = $viewModel;
  }

  public function present()
  {
    $view = $this->getView();

    return $view->getHeader() . $view->getBody() . $view->getFooter();
  }

  
  public function getBetreff()
  {
    return $this->getView()->getNoData();
  }

  protected function createView(): \Kufer\KuferTools\Basis\View\ViewSight
  {
    return new AnwesenheitenSpeichernAbweichendeUEEMailView($this->getViewModel());
  }

  
  protected function getView()
  {
    $this->view = $this->view ?? $this->createView();

    return $this->view;
  }

  
  protected function getViewModel()
  {
    return $this->viewModel;
  }

  public function getSubject(): string
  {
    return $this->getBetreff();
  }

  public function getContent(): string
  {
    return $this->present();
  }

  public function getContentType(): int
  {
    return IEMail::TYPE_HTML;
  }

  public function getAttachments(): array
  {
    return array();
  }
}