Source for file intuition.dbresultset.php

Documentation is available at intuition.dbresultset.php

  1. <?php
  2. /**
  3. * @package    jelix
  4. * @subpackage db_driver
  5. * @author     Yannick Le Guédart
  6. * @copyright  2007 Over-blog, 2007 Yannick Le Guédart
  7. * @link       http://www.jelix.org
  8. * @link       http://www.sinequa.com
  9. * @licence  http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public Licence, see LICENCE file
  10. */
  11.  
  12. /**
  13. * @package    jelix
  14. * @subpackage db_driver
  15. */
  16. class intuitionDbResultSet extends jDbResultSet {
  17.  
  18.     protected $_stmtId;
  19.     protected $_cnt;
  20.  
  21.     function __construct ($idResult, $stmtId = null, $cnt = null){
  22.         $this->_idResult = $idResult;
  23.         $this->_stmtId   = $stmtId;
  24.         $this->_cnt      = $cnt;
  25.     }
  26.  
  27.     public function fetch(){
  28.         $res = false;
  29.         if ($row = $this->_idResult->in_fetch_array ()){
  30.             $res = new stdClass();
  31.             foreach ($row as $key => $value){
  32.                 $res->$key = $value;
  33.             }
  34.         }
  35.         return $res;
  36.     }
  37.  
  38.     protected function _fetch(){ }
  39.  
  40.     protected function _free (){
  41.         return $this->_idResult->close ();
  42.     }
  43.  
  44.     protected function _rewind (){
  45.         return $this->_idResult->in_data_seek (0);
  46.     }
  47.  
  48.     public  function rowCount (){
  49.         return $this->_idResult->in_num_rows ();
  50.     }
  51.  
  52.     public function bindColumn($column, &$param , $type=null) {
  53.         throw new JException (
  54.             'jelix~db.error.feature.unsupported', 
  55.             array ('pgsql','bindColumn')); 
  56.     }
  57.  
  58.     public function bindParam (    $parameter, &$variable , $data_type = null, 
  59.             $length = null, $driver_options = null){
  60.         throw new JException (
  61.             'jelix~db.error.feature.unsupported', 
  62.             array ('pgsql','bindParam')); 
  63.     }
  64.  
  65.     public function bindValue ($parameter, $value, $data_type) {
  66.         throw new JException (
  67.             'jelix~db.error.feature.unsupported', 
  68.             array ('pgsql','bindValue')); 
  69.     }
  70.  
  71.     public function columnCount(){
  72.         return $this->_idResult->_fields ();
  73.     }
  74.  
  75.     public function execute ($parameters = array ()){
  76.         throw new JException (
  77.             'jelix~db.error.feature.unsupported', 
  78.             array ('pgsql','bindValue')); 
  79.     }
  80. }

Documentation generated on Mon, 19 Sep 2011 14:11:46 +0200 by phpDocumentor 1.4.3