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


class ExportKinder extends ExportMitPflichtUndValidierungsFehler
{
  public $validierungsFehler = array();
  public $pflichtfeldFehler = array();

  
  public function initiate()
  {
    ExportBasis::initiate();
    $this->dboperations = new DBWorkKinder();
  }

  
  public function export()
  {
    $this->clearResult();
    for ($i = 0; $i < count($this->exportsets); $i++) {
      $tmp = $this->dboperations->getKind($this->exportsets[$i]->id);
      if (isset($tmp->id)) {
        array_push($this->exportresults, $tmp);
      }
    }
  }

  
  public function getVarValue($varname)
  {
    switch ($this->getVarCategory($varname)) {
      default: return parent::getVarValue($varname);
      case 'ki_': return $this->expCalculation->getVarValue4Kinder($this->getVarName($varname), $this->exportresults[$this->actualset]);
      case 'kiedit_': return $this->expCalculation->getVarValue4KinderEdit($this->getVarName($varname), $this->exportresults[$this->actualset]);
    }
  }
}