Source for file Ylesanded.php
Documentation is available at Ylesanded.php
class Model_Ylesanded extends Zend_Db_Table_Abstract {
protected $_name =
'ylesanne';
public function fetchRyhmKat()
$select =
$this->select();
$select->from(array('r' =>
'ryhm'), array('RyhmaID', 'RyhmaNimi'));
return $this->fetchAll($select);
public function fetchYlesandedByVKP($ID, $voistlusID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array('YlesandeID', 'VoistluseKuupaevaID', 'VoistluseID', 'RyhmaID', 'JrkNR', 'AineID','LisajaID', 'Ajatempel'))
->join(array('a' =>
'aine'), 'a.AineID=y.AineID', array('AineNimi'))
->join(array('v' =>
'voistlus'), 'v.VoistluseID=y.VoistluseID', array('VoistluseNimi'))
->join(array('r' =>
'ryhm'), 'r.RyhmaID=y.RyhmaID', array('RyhmaNimi'))
->join(array('t' =>
'tekst'), 't.YlesandeID=y.YlesandeID', array('Tekst'))
->where('y.VoistluseKuupaevaID = ?', $ID)
->where('y.VoistluseID = ?', $voistlusID)
->where('t.KeeleID = 1');
$select->order('VoistluseNimi ASC');
return $this->fetchAll($select);
public function fetchYlesandedByVoistlusID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array('YlesandeID', 'VoistluseKuupaevaID', 'VoistluseID', 'RyhmaID', 'AineID','LisajaID', 'Ajatempel'))
->join(array('k' =>
'kasutaja'), 'k.KasutajaID=y.LisajaID', array('Kasutajanimi'))
->join(array('a' =>
'aine'), 'a.AineID=y.AineID', array('AineNimi'))
->join(array('v' =>
'voistlus'), 'v.VoistluseID=y.VoistluseID', array('VoistluseNimi'))
->join(array('r' =>
'ryhm'), 'r.RyhmaID=y.RyhmaID', array('RyhmaNimi'))
->join(array('t' =>
'tekst'), 't.YlesandeID=y.YlesandeID', array('Tekst'))
->where(' y.VoistluseID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesandedByAineID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array('YlesandeID', 'VoistluseKuupaevaID', 'VoistluseID', 'RyhmaID', 'AineID','LisajaID', 'Ajatempel'))
->join(array('k' =>
'kasutaja'), 'k.KasutajaID=y.LisajaID', array('Kasutajanimi'))
->join(array('a' =>
'aine'), 'a.AineID=y.AineID', array('AineNimi'))
->join(array('v' =>
'voistlus'), 'v.VoistluseID=y.VoistluseID', array('VoistluseNimi'))
->join(array('r' =>
'ryhm'), 'r.RyhmaID=y.RyhmaID', array('RyhmaNimi'))
->join(array('t' =>
'tekst'), 't.YlesandeID=y.YlesandeID', array('Tekst'))
->where(' y.AineID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesanneByID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array('YlesandeID', 'VoistluseKuupaevaID', 'VoistluseID', 'RyhmaID', 'AineID','LisajaID', 'Ajatempel'))
->join(array('a' =>
'aine'), 'a.AineID=y.AineID', array('AineNimi'))
->join(array('v' =>
'voistlus'), 'v.VoistluseID=y.VoistluseID', array('VoistluseNimi'))
->join(array('r' =>
'ryhm'), 'r.RyhmaID=y.RyhmaID', array('RyhmaNimi'))
->where(' y.YlesandeID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesandeTekstidByID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array())
->join(array('t' =>
'tekst'), 't.YlesandeID=y.YlesandeID', array('TekstiID', 'Tekst', 'Ajatempel'))
->join(array('k' =>
'keel'), 'k.KeeleID=t.KeeleID', array('KeeleNimi'))
->where(' y.YlesandeID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesandeVastusedByID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array())
->join(array('v' =>
'vastus'), 'v.YlesandeID=y.YlesandeID', array('VastuseID', 'Vastus', 'Ajatempel'))
->join(array('k' =>
'keel'), 'k.KeeleID=v.KeeleID', array('KeeleNimi'))
->where(' y.YlesandeID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesandeLahendusedByID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array())
->join(array('l' =>
'lahendus'), 'l.YlesandeID=y.YlesandeID', array('LahenduseID', 'LahenduseTekst', 'LisajaNimi', 'LisajaEmail', 'LisajaIP', 'Kontrollitud', 'Ajatempel'))
->join(array('k' =>
'keel'), 'k.KeeleID=l.KeeleID', array('KeeleNimi'))
->where(' y.YlesandeID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesandeKommentaaridByID($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array())
->join(array('k' =>
'kommentaar'), 'k.YlesandeID=y.YlesandeID', array('KommentaariID', 'Avalik', 'Kommentaar', 'KomNimi', 'KomEmail', 'KomIP', 'Agent', 'Ajatempel'))
->where(' y.YlesandeID = ?', $ID);
return $this->fetchAll($select);
public function fetchYlesanded_V_A_R_K($ID)
$select =
$this->select();
$select->setIntegrityCheck(false);
$select->from(array('y' =>
'ylesanne'), array())
->join(array('k' =>
'kommentaar'), 'k.YlesandeID=y.YlesandeID', array('KommentaariID', 'Avalik', 'Kommentaar', 'KomNimi', 'KomEmail', 'KomIP', 'Agent', 'Ajatempel'))
->where(' y.YlesandeID = ?', $ID);
return $this->fetchAll($select);
Documentation generated on Wed, 15 Jun 2011 15:58:45 +0300 by phpDocumentor 1.4.1