Source for file Voistlused.php

Documentation is available at Voistlused.php

  1. <?php
  2. /**
  3.  * Model for handling queries with database table 'voistlus'.
  4.  * 
  5.  * @author Margus Sellin <margus@bitweb.ee>
  6.  * @copyright Copyright (C) 2011. All rights reserved. Margus Sellin
  7.  * @package Model
  8.  * @project olymp
  9.  * 
  10.  */
  11.     class Model_Voistlused extends Zend_Db_Table_Abstract {
  12.         
  13.         protected $_name = 'voistlus';
  14.  
  15.         public function fetchByDates()
  16.         {
  17.             $select $this->select();
  18.             $select->from($this)
  19.                     ->order('Kuupaev ASC');
  20.             return $this->fetchAll($select);
  21.         }
  22.         
  23.         public function fetchVoistlused()
  24.         {
  25.             $select $this->select();
  26.             $select->from(array('v' => 'voistlus')array('VoistluseID''VoistluseNimi'));
  27.             
  28.             return $this->fetchAll($select);
  29.         }
  30.         
  31.         public function fetchTulemustabelByID($ID)
  32.         {
  33.             $select $this->select();
  34.             $select->from(array('v' => 'voistlus')array('VoistluseID''tulemustabel'))
  35.                 ->where("VoistluseID = ?"$ID);
  36.             
  37.             return $this->fetchRow($select);
  38.         }
  39.         
  40.         
  41.         public function fetchVoistlusedDetailed()
  42.         {
  43.             $select $this->select();
  44.             $select->setIntegrityCheck(false)
  45.             $select->from(array('v' => 'voistlus')array('VoistluseID''VoistluseNimi''LisajaID''Ajatempel'))
  46.                 ->join(array('k' => 'kasutaja')'k.KasutajaID=v.LisajaID'array('Kasutajanimi'));
  47.             $select->order('Ajatempel DESC');
  48.             return $this->fetchAll($select);
  49.         }
  50.         
  51.     }
  52. ?>

Documentation generated on Tue, 14 Jun 2011 21:12:02 +0300 by phpDocumentor 1.4.1