Source for file Ylesanded.php

Documentation is available at Ylesanded.php

  1. <?php
  2. /**
  3.  * @ignore
  4.  */
  5.     class Model_Ylesanded extends Zend_Db_Table_Abstract {
  6.         
  7.         protected $_name 'ylesanne';
  8.  
  9.         public function fetchRyhmKat()
  10.         {
  11.             $select $this->select();
  12.             $select->from(array('r' => 'ryhm')array('RyhmaID''RyhmaNimi'));
  13.             
  14.             return $this->fetchAll($select);
  15.         }
  16.         
  17.         public function fetchYlesandedByVKP($ID$voistlusID)
  18.         {
  19.             $select $this->select();
  20.             $select->setIntegrityCheck(false)
  21.             $select->from(array('y' => 'ylesanne')array('YlesandeID''VoistluseKuupaevaID''VoistluseID''RyhmaID''JrkNR''AineID','LisajaID''Ajatempel'))
  22.                 ->join(array('a' => 'aine')'a.AineID=y.AineID'array('AineNimi'))
  23.                 ->join(array('v' => 'voistlus')'v.VoistluseID=y.VoistluseID'array('VoistluseNimi'))
  24.                 ->join(array('r' => 'ryhm')'r.RyhmaID=y.RyhmaID'array('RyhmaNimi'))
  25.                 ->join(array('t' => 'tekst')'t.YlesandeID=y.YlesandeID'array('Tekst'))
  26.                 ->where('y.VoistluseKuupaevaID = ?'$ID)
  27.                 ->where('y.VoistluseID = ?'$voistlusID)
  28.                 ->where('t.KeeleID = 1');
  29.             $select->order('VoistluseNimi ASC');
  30.             return $this->fetchAll($select);
  31.  
  32.         }
  33.         
  34.         public function fetchYlesandedByVoistlusID($ID)
  35.         {
  36.             $select $this->select();
  37.             $select->setIntegrityCheck(false)
  38.             $select->from(array('y' => 'ylesanne')array('YlesandeID''VoistluseKuupaevaID''VoistluseID''RyhmaID''AineID','LisajaID''Ajatempel'))
  39.                 ->join(array('k' => 'kasutaja')'k.KasutajaID=y.LisajaID'array('Kasutajanimi'))
  40.                 ->join(array('a' => 'aine')'a.AineID=y.AineID'array('AineNimi'))
  41.                 ->join(array('v' => 'voistlus')'v.VoistluseID=y.VoistluseID'array('VoistluseNimi'))
  42.                 ->join(array('r' => 'ryhm')'r.RyhmaID=y.RyhmaID'array('RyhmaNimi'))
  43.                 ->join(array('t' => 'tekst')'t.YlesandeID=y.YlesandeID'array('Tekst'))
  44.                 ->where(' y.VoistluseID = ?'$ID);
  45.             return $this->fetchAll($select);
  46.         }
  47.         
  48.         
  49.         public function fetchYlesandedByAineID($ID)
  50.         {
  51.             $select $this->select();
  52.             $select->setIntegrityCheck(false)
  53.             $select->from(array('y' => 'ylesanne')array('YlesandeID''VoistluseKuupaevaID''VoistluseID''RyhmaID''AineID','LisajaID''Ajatempel'))
  54.                 ->join(array('k' => 'kasutaja')'k.KasutajaID=y.LisajaID'array('Kasutajanimi'))
  55.                 ->join(array('a' => 'aine')'a.AineID=y.AineID'array('AineNimi'))
  56.                 ->join(array('v' => 'voistlus')'v.VoistluseID=y.VoistluseID'array('VoistluseNimi'))
  57.                 ->join(array('r' => 'ryhm')'r.RyhmaID=y.RyhmaID'array('RyhmaNimi'))
  58.                 ->join(array('t' => 'tekst')'t.YlesandeID=y.YlesandeID'array('Tekst'))
  59.                 ->where(' y.AineID = ?'$ID);
  60.             return $this->fetchAll($select);
  61.         }
  62.         
  63.         public function fetchYlesanneByID($ID)
  64.         {
  65.             $select $this->select();
  66.             $select->setIntegrityCheck(false)
  67.             $select->from(array('y' => 'ylesanne')array('YlesandeID''VoistluseKuupaevaID''VoistluseID''RyhmaID''AineID','LisajaID''Ajatempel'))
  68.                 ->join(array('a' => 'aine')'a.AineID=y.AineID'array('AineNimi'))
  69.                 ->join(array('v' => 'voistlus')'v.VoistluseID=y.VoistluseID'array('VoistluseNimi'))
  70.                 ->join(array('r' => 'ryhm')'r.RyhmaID=y.RyhmaID'array('RyhmaNimi'))
  71.                 ->where(' y.YlesandeID = ?'$ID);
  72.             return $this->fetchAll($select);
  73.         }
  74.         
  75.         public function fetchYlesandeTekstidByID($ID)
  76.         {
  77.             $select $this->select();
  78.             $select->setIntegrityCheck(false)
  79.             $select->from(array('y' => 'ylesanne')array())
  80.                 ->join(array('t' => 'tekst')'t.YlesandeID=y.YlesandeID'array('TekstiID''Tekst''Ajatempel'))
  81.                 ->join(array('k' => 'keel')'k.KeeleID=t.KeeleID'array('KeeleNimi'))
  82.                 ->where(' y.YlesandeID = ?'$ID);
  83.             return $this->fetchAll($select);
  84.         }
  85.         
  86.         
  87.         public function fetchYlesandeVastusedByID($ID)
  88.         {
  89.             $select $this->select();
  90.             $select->setIntegrityCheck(false)
  91.             $select->from(array('y' => 'ylesanne')array())
  92.                 ->join(array('v' => 'vastus')'v.YlesandeID=y.YlesandeID'array('VastuseID''Vastus''Ajatempel'))
  93.                 ->join(array('k' => 'keel')'k.KeeleID=v.KeeleID'array('KeeleNimi'))
  94.                 ->where(' y.YlesandeID = ?'$ID);
  95.             return $this->fetchAll($select);
  96.         }
  97.     
  98.         public function fetchYlesandeLahendusedByID($ID)
  99.         {
  100.             $select $this->select();
  101.             $select->setIntegrityCheck(false)
  102.             $select->from(array('y' => 'ylesanne')array())
  103.                 ->join(array('l' => 'lahendus')'l.YlesandeID=y.YlesandeID'array('LahenduseID''LahenduseTekst''LisajaNimi''LisajaEmail''LisajaIP''Kontrollitud''Ajatempel'))
  104.                 ->join(array('k' => 'keel')'k.KeeleID=l.KeeleID'array('KeeleNimi'))
  105.                 ->where(' y.YlesandeID = ?'$ID);
  106.             return $this->fetchAll($select);
  107.         }
  108.         
  109.         public function fetchYlesandeKommentaaridByID($ID)
  110.         {
  111.             $select $this->select();
  112.             $select->setIntegrityCheck(false)
  113.             $select->from(array('y' => 'ylesanne')array())
  114.                 ->join(array('k' => 'kommentaar')'k.YlesandeID=y.YlesandeID'array('KommentaariID''Avalik''Kommentaar''KomNimi''KomEmail''KomIP''Agent''Ajatempel'))
  115.                 ->where(' y.YlesandeID = ?'$ID);
  116.             return $this->fetchAll($select);
  117.         }
  118.         
  119.         public function fetchYlesanded_V_A_R_K($ID)
  120.         {
  121.             $select $this->select();
  122.             $select->setIntegrityCheck(false)
  123.             $select->from(array('y' => 'ylesanne')array())
  124.                 ->join(array('k' => 'kommentaar')'k.YlesandeID=y.YlesandeID'array('KommentaariID''Avalik''Kommentaar''KomNimi''KomEmail''KomIP''Agent''Ajatempel'))
  125.                 ->where(' y.YlesandeID = ?'$ID);
  126.             return $this->fetchAll($select);
  127.         }
  128.         
  129.     }
  130. ?>

Documentation generated on Wed, 15 Jun 2011 15:58:45 +0300 by phpDocumentor 1.4.1