[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/dbal/src/drivers/ -> lmbDbBaseRecordSet.class.php (source)

   1  <?php
   2  /*
   3   * Limb PHP Framework
   4   *
   5   * @link http://limb-project.com 
   6   * @copyright  Copyright &copy; 2004-2007 BIT(http://bit-creative.com)
   7   * @license    LGPL http://www.gnu.org/copyleft/lesser.html 
   8   */
   9  lmb_require('limb/dbal/src/drivers/lmbDbRecordSet.interface.php');
  10  
  11  /**

  12   * abstract class lmbDbBaseRecordSet.

  13   *

  14   * @package dbal

  15   * @version $Id$

  16   */
  17  abstract class lmbDbBaseRecordSet implements lmbDbRecordSet
  18  {
  19    protected $offset;
  20    protected $limit;
  21    protected $sort_params;
  22  
  23    function paginate($offset, $limit)
  24    {
  25      $this->offset = $offset;
  26      $this->limit = $limit;
  27      return $this;
  28    }
  29  
  30    function getOffset()
  31    {
  32      return $this->offset;
  33    }
  34  
  35    function getLimit()
  36    {
  37      return $this->limit;
  38    }
  39  
  40    function sort($params)
  41    {
  42      $this->sort_params = $params;
  43      return $this;
  44    }
  45  
  46    function getArray()
  47    {
  48      $array = array();
  49      foreach($this as $record)
  50        $array[] = $record;
  51      return $array;
  52    }
  53  
  54    //ArrayAccess interface
  55    function offsetExists($offset)
  56    {
  57      return !is_null($this->offsetGet($offset));
  58    }
  59  
  60    function offsetGet($offset)
  61    {
  62      if(is_numeric($offset))
  63        return $this->at((int)$offset);
  64    }
  65  
  66    function offsetSet($offset, $value){}
  67  
  68    function offsetUnset($offset){}
  69    //end
  70  }
  71  
  72  ?>


Generated: Tue Oct 7 05:02:03 2008 Cross-referenced by PHPXref 0.7