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


class ExportColumnDifference extends ExportColumn
{
  
  protected $oldDatamodul;

  
  public $expCalculation;

  
  public function __construct($datamodul, $oldDatamodul, $isFormular, string $requestPrefix = '')
  {
    parent::__construct($datamodul, $isFormular, $requestPrefix);
    $this->oldDatamodul = $oldDatamodul;
  }

  
  public function initiate()
  {
    $this->expCalculation = new \ExportCalculationColumnDifference($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);
    }
  }
}