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


class ExportDblOptin extends ExportMitPflichtUndValidierungsFehler
{
  
  public function initiate()
  {
    parent::initiate();
    if (!$this->expCalculation instanceof ExportCalculationDblOptin) {
      $this->expCalculation = new ExportCalculationDblOptin($this);
    }
  }

  
  public function getVarValue($varname)
  {
    switch ($this->getVarCategory($varname)) {
      default: return parent::getVarValue($varname);
      case 'dbloptin_': return $this->expCalculation->getVarValue4DblOptin($this->getVarName($varname), $this->exportresults[$this->actualset]);
      case 'dbloptinedit_': return $this->expCalculation->getVarValue4DblOptinEdit($this->getVarName($varname), $this->exportresults[$this->actualset]);
    }
  }
}

class ExpDblOptin extends Exportadapter
{
  
  public function initiate()
  {
    $this->export = new ExportDblOptin();
  }

  public function setFehler($pPflicht, $pValidierung)
  {
    if ($this->export == null) {
      $this->initiate();
    }
    if (is_array($pPflicht)) {
      $this->export->pflichtfeldFehler = $pPflicht;
    }
    if (is_array($pValidierung)) {
      $this->export->validierungsFehler = $pValidierung;
    }
  }
}