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


class ExportColumn extends ExportBasis
{
  
  protected $dataModul;

  
  protected $isFormular;

  
  public $expCalculation;

  
  public $requestPrefix;

  public function __construct($pDataModul, $pIsFormular = false, string $requestPrefix = '')
  {
    $this->dataModul = $pDataModul;
    $this->isFormular = $pIsFormular;
    $this->requestPrefix = $requestPrefix;
  }

  
  public function initiate()
  {
    if (!isset($this->expCalculation)) {
      $this->expCalculation = new \ExportCalculationColumn($this);
    }
    parent::initiate();
    $this->dboperations = new DBWorkSightsSettings();
  }

  public function export()
  {
    $this->clearResult();
    $this->exportresults = $this->exportsets;
  }

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