00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00030 class ColumnInfo {
00031
00032
00033
00034
00035
00036
00038 public $name;
00039
00041 public $type;
00042
00044 public $nativeType;
00045
00047 public $size;
00048
00050 public $precision;
00051
00053 public $scale;
00054
00056 public $isNullable;
00057
00059 public $defaultValue;
00060
00062 public $isAutoIncrement;
00063
00065 public $table;
00066
00071 protected $vendorSpecificInfo = array();
00072
00086 function __construct(TableInfo
00087 $table,
00088 $name,
00089 $type = null,
00090 $nativeType = null,
00091 $size = null,
00092 $precision=null,
00093 $scale = null,
00094 $is_nullable = null,
00095 $default = null,
00096 $is_auto_increment = null,
00097 $vendorInfo = array())
00098 {
00099 $this->table = $table;
00100 $this->name = $name;
00101 $this->type = $type;
00102 $this->nativeType = $nativeType;
00103 $this->size = $size;
00104 $this->precision = $precision;
00105 $this->scale = $scale;
00106 $this->isNullable = $is_nullable;
00107 $this->defaultValue = $default;
00108 $this->isAutoIncrement = $is_auto_increment;
00109 $this->vendorSpecificInfo = $vendorInfo;
00110 }
00111
00118 function __sleep()
00119 {
00120 return array('name', 'type', 'nativeType', 'size', 'precision', 'isNullable', 'defaultValue');
00121 }
00122
00127 public function getName()
00128 {
00129 return $this->name;
00130 }
00131
00136 public function getType()
00137 {
00138 return $this->type;
00139 }
00140
00145 public function getNativeType()
00146 {
00147 return $this->nativeType;
00148 }
00149
00154 public function getSize()
00155 {
00156 return $this->size;
00157 }
00158
00163 public function getPrecision()
00164 {
00165 return $this->precision;
00166 }
00167
00174 public function getScale()
00175 {
00176 return $this->scale;
00177 }
00178
00183 public function getDefaultValue()
00184 {
00185 return $this->defaultValue;
00186 }
00187
00192 public function isNullable()
00193 {
00194 return $this->isNullable;
00195 }
00196
00201 public function isAutoIncrement()
00202 {
00203 return $this->isAutoIncrement === true;
00204 }
00205
00210 public function getVendorSpecificInfo()
00211 {
00212 return $this->vendorSpecificInfo;
00213 }
00214
00218 public function toString()
00219 {
00220 return $this->name;
00221 }
00222
00227 public function getTable()
00228 {
00229 return $this->table;
00230 }
00231
00232 }