[ Index ]

PHP Cross Reference of Limb3

title

Body

[close]

/dbal/src/drivers/pgsql/ -> lmbPgsqlColumnInfo.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/lmbDbColumnInfo.class.php');
  10  lmb_require(dirname(__FILE__) . '/lmbPgsqlTypeInfo.class.php');
  11  
  12  /**

  13   * class lmbPgsqlColumnInfo.

  14   *

  15   * @package dbal

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

  17   */
  18  class lmbPgsqlColumnInfo extends lmbDbColumnInfo
  19  {
  20    protected $nativeType;
  21    protected $isAutoIncrement;
  22    protected $isExisting = false;
  23  
  24    function __construct(
  25                  $table,
  26                  $name,
  27                  $nativeType = null,
  28                  $size = null,
  29                  $scale = null,
  30                  $isNullable = null,
  31                  $default = null,
  32                  $isAutoIncrement = null,
  33                  $isExisting = false)
  34    {
  35  
  36      $this->nativeType = $this->canonicalizeNativeType($nativeType);
  37      $this->isAutoIncrement = $this->canonicalizeIsAutoincrement($isAutoIncrement);
  38  
  39      $typeinfo = new lmbPgsqlTypeInfo();
  40      $typemap = $typeinfo->getNativeToColumnTypeMapping();
  41      $type = $typemap[$nativeType];
  42  
  43      $this->isExisting = $isExisting;
  44  
  45      parent::__construct($table, $name, $type, $size, $scale, $isNullable, $default);
  46    }
  47  
  48    function getNativeType()
  49    {
  50      return $this->nativeType;
  51    }
  52  
  53    function canonicalizeNativeType($nativeType)
  54    {
  55      return $nativeType;
  56    }
  57  
  58    function isAutoIncrement()
  59    {
  60      return $this->isAutoIncrement === true;
  61    }
  62  
  63    function canonicalizeIsAutoIncrement($isAutoIncrement)
  64    {
  65      return is_null($isAutoIncrement) ?  null : (bool) $isAutoIncrement;
  66    }
  67  
  68    function escapeIdentifier($name)
  69    {
  70      return "\"$name\"";
  71    }
  72  }
  73  
  74  ?>


Generated: Sat Nov 22 03:48:54 2008 Cross-referenced by PHPXref 0.7