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


class DozentKurseSight4Tab extends KurseSight4Tab
{
  

  public function __construct($pDozentId, $pKursIdAry4User, $pAdr4KursDetailLink, $pSightId)
  {
    
    parent::__construct($pDozentId, $pKursIdAry4User, $pAdr4KursDetailLink, $pSightId);
  }

  
  public function getData()
  {
    if (isset($this->dataary) && count($this->dataary) > 0) {
      return;
    }
    
    

    
    $this->dbwkurse->newSearch();

    
    $this->dbwkurse->toobject->beginn_dat = isset($this->_kursFilterInput['datBis']) ? $this->_kursFilterInput['datBis'] : '';
    $this->dbwkurse->toobject->ende_dat = isset($this->_kursFilterInput['datVon']) ? $this->_kursFilterInput['datVon'] : '';
    $this->dbwkurse->fromobject->id = isset($this->_kursFilterInput['knrVon']) ? $this->_kursFilterInput['knrVon'] : '';
    $this->dbwkurse->toobject->id = isset($this->_kursFilterInput['knrBis']) ? $this->_kursFilterInput['knrBis'] : '';
    
    $this->dbwkurse->fromobject->kurzbez = isset($this->_kursFilterInput['kursTitel']) ? $this->_kursFilterInput['kursTitel'] : '';

    
    
    
    $this->dbwkurse->fromobject->semester = $this->_semlist;
    $this->dbwkurse->justNoAusfall = $this->_justNoAusfall;

    
    
    $this->dataary = $this->dbwkurse->getKursebyDozentID($this->_personId); 
  }

  
  public function isSearchDozentNeeded()
  {
    return true;
  }

  
  public function getCount()
  {
    if (isset($this->dataary)) {
      return count($this->dataary);
    } else {
      $this->getData();
      if (isset($this->dataary)) {
        return count($this->dataary);
      } else {
        return 0;
      }
    }
  }

  
}