[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/wact/src/components/ -> WactDatasourceRuntimeComponent.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  
  10  /**
  11   * Base class for runtime components that hold data
  12   * @package wact
  13   * @version $Id: WactDatasourceRuntimeComponent.class.php 5945 2007-06-06 08:31:43Z pachanga $
  14   */
  15  class WactDatasourceRuntimeComponent extends WactRuntimeComponent implements ArrayAccess
  16  {
  17    protected $datasource;
  18  
  19    function __construct($id)
  20    {
  21      parent :: __construct($id);
  22  
  23      $this->datasource = new WactArrayObject(new ArrayObject());
  24    }
  25  
  26    function set($field, $value)
  27    {
  28      $this->datasource->set($field, $value);
  29    }
  30  
  31    function get($field)
  32    {
  33      return $this->datasource->get($field);
  34    }
  35  
  36    function getDatasourceComponent()
  37    {
  38      return $this;
  39    }
  40  
  41    function registerDataSource($datasource)
  42    {
  43      $this->datasource = new WactArrayObject($datasource);
  44    }
  45  
  46    function getDataSource()
  47    {
  48      return $this->datasource;
  49    }
  50  
  51    function offsetGet($offset)
  52    {
  53      return $this->get($offset);
  54    }
  55  
  56    function offsetSet($offset, $value)
  57    {
  58      $this->set($offset, $value);
  59    }
  60  
  61    function offsetExists($offset)
  62    {
  63      return isset($this->datasource[$offset]);
  64    }
  65  
  66    function offsetUnset($offset)
  67    {
  68      unset($this->datasource[$offset]);
  69    }
  70  }
  71  
  72  ?>


Generated: Mon Dec 1 03:56:46 2008 Cross-referenced by PHPXref 0.7