Source for file pdo.php

Documentation is available at pdo.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Platform
  4.  * @subpackage  Database
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('JPATH_PLATFORM'or die;
  11.  
  12. /**
  13.  * PDO database iterator.
  14.  *
  15.  * @package     Joomla.Platform
  16.  * @subpackage  Database
  17.  * @since       12.1
  18.  */
  19. {
  20.     /**
  21.      * Get the number of rows in the result set for the executed SQL given by the cursor.
  22.      *
  23.      * @return  integer  The number of rows in the result set.
  24.      *
  25.      * @since   12.1
  26.      * @see     Countable::count()
  27.      */
  28.     public function count()
  29.     {
  30.         if (!empty($this->cursor&& $this->cursor instanceof PDOStatement)
  31.         {
  32.             return $this->cursor->rowCount();
  33.         }
  34.         else
  35.         {
  36.             return 0;
  37.         }
  38.     }
  39.  
  40.     /**
  41.      * Method to fetch a row from the result set cursor as an object.
  42.      *
  43.      * @return  mixed   Either the next row from the result set or false if there are no more rows.
  44.      *
  45.      * @since   12.1
  46.      */
  47.     protected function fetchObject()
  48.     {
  49.         if (!empty($this->cursor&& $this->cursor instanceof PDOStatement)
  50.         {
  51.             return $this->cursor->fetchObject($this->class);
  52.         }
  53.         else
  54.         {
  55.             return false;
  56.         }
  57.     }
  58.  
  59.     /**
  60.      * Method to free up the memory used for the result set.
  61.      *
  62.      * @return  void 
  63.      *
  64.      * @since   12.1
  65.      */
  66.     protected function freeResult()
  67.     {
  68.         if (!empty($this->cursor&& $this->cursor instanceof PDOStatement)
  69.         {
  70.             $this->cursor->closeCursor();
  71.         }
  72.     }
  73. }

Documentation generated on Tue, 19 Nov 2013 15:10:28 +0100 by phpDocumentor 1.4.3