tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Source for file db_recordset_installer.class.php

Documentation is available at db_recordset_installer.class.php

  1. <?php
  2. // *** Tangra (Application Framework and Tools for PHP)
  3. //  $Id$
  4. //
  5.  
  6. /**
  7.  * Contains DB_Recordset_Installer class
  8.  *
  9.  * @package tangra_lib
  10.  * @subpackage db
  11.  */
  12.  
  13. /**
  14.  *
  15.  */
  16. require_once(TANGRA_MAIN_DIR.'interfaces/i_db_recordset.class.php');
  17.  
  18.  
  19. /**
  20.  * This class is ment to be used ONLY by module installers
  21.  *
  22.  * @package tangra_lib
  23.  * @subpackage db
  24.  *
  25.  */
  26. class DB_Recordset_Installer extends Tangra_Class implements I_DB_Recordset {
  27.     /**
  28.      * Holds records set
  29.      *
  30.      * @var recordset 
  31.      * @internal
  32.      */
  33.     private $rs;
  34.  
  35.     /**
  36.      * Constructor
  37.      *
  38.      * @param ADORecordSet $rs 
  39.      */
  40.     function __construct(&$rs{
  41.         if ($rs instanceof ADORecordSet{
  42.             $this->rs = $rs;
  43.         }
  44.     }
  45.  
  46.  
  47.     /**
  48.      * Fetches one row from recordset
  49.      *
  50.      * @return array 
  51.      */
  52.     public function fetch_row({
  53.         $old_err_rep error_reporting(SYSTEM_ERROR_REPORTING_PHP4_LIBS);
  54.         $rez $this->rs->FetchRow();
  55.         error_reporting($old_err_rep);
  56.  
  57.         return $rez;
  58.     }
  59.  
  60.  
  61.     /**
  62.      * Fetches one row as object from recordset
  63.      *
  64.      * @return mixed 
  65.      */
  66.     public function fetch_object({
  67.         $old_err_rep error_reporting(SYSTEM_ERROR_REPORTING_PHP4_LIBS);
  68.         $rez $this->rs->FetchNextObject(true);
  69.         error_reporting($old_err_rep);
  70.  
  71.         return $rez;
  72.     }
  73.  
  74.  
  75.     /**
  76.      * Is end of recordset
  77.      *
  78.      * @return boolean Returns true if there are no rows in the recordset (or it is empty)
  79.      */
  80.     public function is_eof({
  81.         return $this->rs->EOF;
  82.     }
  83.  
  84.  
  85.     /**
  86.      * Alias of is_eof()
  87.      *
  88.      * @return boolean Returns true if there are no rows in the recordset (or it is empty)
  89.      */
  90.     public function is_eod({
  91.         return $this->is_eof();
  92.     }
  93.  
  94.  
  95.     /**
  96.      * Closes the recordset
  97.      *
  98.      */
  99.     public function close({
  100.         $this->rs->Close();
  101.     }
  102. }