Source for file Kool.php

Documentation is available at Kool.php

  1. <?php
  2. /**
  3.  * Model for handling queries with database table 'kool'.
  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_Kool extends Zend_Db_Table_Abstract {
  12.         /**
  13.          * Database table name
  14.          * @access protected
  15.          * @var string 
  16.          */
  17.         protected $_name = 'kool';
  18.         
  19.         /**
  20.          * Query fetchByName.
  21.          * Database query that fetches a row from 'kool' table where
  22.          * column 'nimi' equals the given parameter.
  23.          * 
  24.          * @access public
  25.          * @param string $name School name
  26.          * @return mixed $result Query resultset
  27.          */
  28.         public function fetchByName($name)
  29.         {
  30.             $select $this->select();
  31.             $select->from($this)
  32.                     ->where('nimi = ?'$name);
  33.             $result $this->fetchRow($select);
  34.             return $result;
  35.         }
  36.         /**
  37.          * @ignore
  38.          */
  39.         public function fetchAllJSON()
  40.         {
  41.             $select $this->select();
  42.             $select->from(array('k' => 'kool')array('id''nimi AS text'));
  43.             return $this->fetchAll($select);
  44.         }
  45.         /**
  46.          * @ignore
  47.          */
  48.         public function fetchByID($id)
  49.         {
  50.             $select $this->select();
  51.             $select->from(array('k' => 'kool')array('id''nimi'))
  52.                     ->where('id = ?'$id);
  53.             return $this->fetchRow($select);
  54.         }
  55.         
  56.     }
  57. ?>

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