Source for file Kuupaevad.php

Documentation is available at Kuupaevad.php

  1. <?php
  2. /**
  3.  * Model for handling queries with database table 'voistlustekuupaevad'.
  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_Kuupaevad extends Zend_Db_Table_Abstract {
  12.         /**
  13.          * Database table name
  14.          * @access protected
  15.          * @var string 
  16.          */
  17.         protected $_name = 'voistlustekuupaevad';
  18.  
  19.         /**
  20.          * Query fetchByDates.
  21.          * Database query that fetches all rows from 'voistlustekuupaevad'
  22.          * table in ascending order.
  23.          * 
  24.          * @access public
  25.          * @return mixed $result Query resultset
  26.          */
  27.         public function fetchByDates()
  28.         {
  29.             $select $this->select();
  30.             $select->from($this)
  31.                     ->order('Kuupaev DESC');
  32.             $result $this->fetchAll($select);
  33.             return $result;
  34.         }
  35.         /**
  36.          * Query fetchByDate.
  37.          * Database query that fetches a row from 'voistlustekuupaevad' table
  38.          * where column 'Kuupaev' equals the given parameter.
  39.          * 
  40.          * @access public
  41.          * @param string $date Date string
  42.          * @return mixed $result Query resultset
  43.          */
  44.         public function fetchByDate($date)
  45.         {
  46.             $select $this->select();
  47.             $select->from($this)
  48.                     ->where('Kuupaev = ?'$date);
  49.             $result $this->fetchRow($select);
  50.             return $result;
  51.         }
  52.         /**
  53.          * @ignore
  54.          */
  55.         public function fetchIDByKuupaevAineVoistlus($kuupaev$aineID$voistlus)
  56.         {
  57.             $select $this->select();
  58.             $select->from($this)
  59.                     ->where('Kuupaev = ?'$kuupaev)
  60.                     ->where('AineID = ?'$aineID)
  61.                     ->where('VoistluseID = ?'$voistlus);
  62.             return $this->fetchRow($select);
  63.         }
  64.     }
  65. ?>

Documentation generated on Mon, 20 Jun 2011 05:43:06 +0300 by phpDocumentor 1.4.1