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


class ExportColumnDifference extends ExportColumn
{
  
  protected $toolSection;
  
  protected $toolSettings;

  
  protected $oldDatamodul;

  
  public $expCalculation;

  
  public function __construct(
    \Kufer\Web\KuferTools\Basis\UseCaseBuilder\ToolSection $toolSection,
    \ToolSettings $toolSettings,
    $datamodul,
    $oldDatamodul,
    $isFormular,
    string $requestPrefix = ''
  ) {
    parent::__construct($toolSection, $toolSettings, $datamodul, $isFormular, $requestPrefix);
    $this->oldDatamodul = $oldDatamodul;
  }

  
  public function initiate()
  {
    $this->expCalculation = new \ExportCalculationColumnDifference($this->toolSection, $this->toolSettings, $this);
    parent::initiate();
  }

  
  public function getVarValue($varname)
  {
    switch ($this->getVarCategory($varname)) {
      default: return ExportBasis::getVarValue($varname);
      case 'columndiff_':
      case 'column_': return $this->expCalculation->getVarValue4ColumnDiff($this->getVarName($varname), $this->exportresults[$this->actualset], $this->dataModul, $this->oldDatamodul, $this->isFormular, $this->requestPrefix);
    }
  }
}