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

class ZsaBkBvTnSuchAPI extends SuchAPI
{
  
  public function __construct()
  {
    $this->fromsearchdm = array(
        's_name' => 'teilnehmer->name',
        's_ds' => 'ds',
        's_zb' => 'zb',
        's_status' => 'status');
  }

  public function getTnSearchLink()
  {
    
    
    return $this->getLinkToCurrentToolSection() . '&searchbkbvtn=1';
  }

  public function getFromObjectBySession($dm, $pTool, $pWildCardReplace = true)
  {
    $dm = parent::getFromObjectBySession($dm, $pTool, $pWildCardReplace);

    
    $arr = $this->fromsearchdm;
    foreach ($arr as $currkey => $value) {
      if ($value == 'teilnehmer->name') {
        $name = SessionOperations::getVarValueWTIntern('s' . $currkey . '_' . $pTool, '');
        $dm->teilnehmer->name = $name;
      }
    }

    return $dm;
  }
}