[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/dbal/src/drivers/oci/ -> lmbOciRecord.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/lmbDbBaseRecord.class.php');
  10  
  11  /**

  12   * class lmbOciRecord.

  13   *

  14   * @package dbal

  15   * @version $Id: lmbOciRecord.class.php 5945 2007-06-06 08:31:43Z pachanga $

  16   */
  17  class lmbOciRecord extends lmbDbBaseRecord
  18  {
  19    protected $properties = array();
  20  
  21    function __construct($data = array())
  22    {
  23      $this->import($data);
  24    }
  25  
  26    function get($name)
  27    {
  28      //Character encoding issue? Charset of identifiers?
  29      $upname = strtoupper($name);
  30      if(isset($this->properties[$upname]))
  31        return $this->properties[$upname];
  32      elseif(isset($this->properties[$name])) //a quick hack
  33        return $this->properties[$name];
  34    }
  35  
  36    function remove($name)
  37    {
  38      $upname = strtoupper($name);
  39      if(isset($this->properties[$upname]))
  40        unset($this->properties[$upname]);
  41      elseif(isset($this->properties[$name]))
  42        unset($this->properties[$name]);
  43    }
  44  
  45    function has($name)
  46    {
  47      $upname = strtoupper($name);
  48      return isset($this->properties[$upname]) ||
  49             isset($this->properties[$name]);
  50    }
  51  
  52    function reset()
  53    {
  54      $this->properties = array();
  55    }
  56  
  57    function set($name, $value)
  58    {
  59      $this->properties[$name] = $value;
  60    }
  61  
  62    function export()
  63    {
  64      return array_change_key_case($this->properties, CASE_LOWER);
  65    }
  66  
  67    function import($values)
  68    {
  69      $this->properties = array();
  70  
  71      if(!is_array($values))
  72        return;
  73  
  74      foreach($values as $key => $value)
  75      {
  76        if(is_a($value, 'OCI-Lob')) //should we delay it until getter is called?
  77          $this->properties[$key] = $value->load();
  78        else
  79          $this->properties[$key] = $value;
  80      }
  81    }
  82  
  83    function getInteger($name)
  84    {
  85      $value = $this->get($name);
  86      return is_null($value) ?  null : (int) $value;
  87    }
  88  
  89    function getFloat($name)
  90    {
  91      $value = $this->get($name);
  92      return is_null($value) ?  null : (float) $value;
  93    }
  94  
  95    function getString($name)
  96    {
  97      $value = $this->get($name);
  98      return is_null($value) ?  null : (string) $value;
  99    }
 100  
 101    function getBoolean($name)
 102    {
 103      $value = $this->get($name);
 104      return is_null($value) ? null : (boolean) $value;
 105    }
 106  
 107    function getBlob($name)
 108    {
 109      return $this->get($name);
 110    }
 111  
 112    function getClob($name)
 113    {
 114      return $this->get($name);
 115    }
 116  
 117    function getIntegerTimeStamp($name)
 118    {
 119    }
 120  
 121    function getStringDate($name)
 122    {
 123    }
 124  
 125    function getStringTime($name)
 126    {
 127    }
 128  
 129    function getStringTimeStamp($name)
 130    {
 131    }
 132  
 133    function getStringFixed($name)
 134    {
 135      $value = $this->get($name);
 136      return is_null($value) ?  null : (string) $value;
 137    }
 138  }
 139  
 140  ?>


Generated: Tue Oct 14 04:47:40 2008 Cross-referenced by PHPXref 0.7