ColumnInfo Class Reference

List of all members.

Public Member Functions

 __construct (TableInfo $table, $name, $type=null, $nativeType=null, $size=null, $precision=null, $scale=null, $is_nullable=null, $default=null, $is_auto_increment=null, $vendorInfo=array())
 Construct a new ColumnInfo object.
 __sleep ()
 This "magic" method is invoked upon serialize().
 getName ()
 Get column name.
 getType ()
 Get column type.
 getNativeType ()
 Gets the native type name.
 getSize ()
 Get column size.
 getPrecision ()
 Get column precision.
 getScale ()
 Get column scale.
 getDefaultValue ()
 Get the default value.
 isNullable ()
 Is column nullable?
 isAutoIncrement ()
 Is column of autoincrement type?
 getVendorSpecificInfo ()
 Get vendor specific optional information for this column.
 toString ()
 getTable ()
 Get parent table.

Public Attributes

 $name
 Column name.
 $type
 Column Creole type.
 $nativeType
 Column native type.
 $size
 Column length.
 $precision
 Column presision.
 $scale
 Column scale (number of digits after decimal ).
 $isNullable
 Is nullable?
 $defaultValue
 Default value.
 $isAutoIncrement
 Is autoincrement?
 $table
 Table.

Protected Attributes

 $vendorSpecificInfo = array()


Detailed Description

Definition at line 30 of file ColumnInfo.php.


Constructor & Destructor Documentation

ColumnInfo::__construct ( TableInfo table,
name,
type = null,
nativeType = null,
size = null,
precision = null,
scale = null,
is_nullable = null,
default = null,
is_auto_increment = null,
vendorInfo = array() 
)

Construct a new ColumnInfo object.

Parameters:
TableInfo $table The table that owns this column.
string $name Column name.
int $type Creole type.
string $nativeType Native type name.
int $size Column length.
int $scale Column scale (number of digits after decimal).
boolean $is_nullable Whether col is nullable.
mixed $default Default value.
boolean $is_auto_increment Whether col is of autoIncrement type.

Definition at line 86 of file ColumnInfo.php.

References $name, $nativeType, $precision, $scale, $size, $type, isAutoIncrement(), and isNullable().

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     }


Member Function Documentation

ColumnInfo::__sleep (  ) 

This "magic" method is invoked upon serialize().

Because the Info class hierarchy is recursive, we must handle the serialization and unserialization of this object.

Returns:
array The class variables that should be serialized (all must be public!).

Definition at line 118 of file ColumnInfo.php.

00119     {
00120         return array('name', 'type', 'nativeType', 'size', 'precision', 'isNullable', 'defaultValue');
00121     }

ColumnInfo::getDefaultValue (  ) 

Get the default value.

Returns:
mixed

Definition at line 183 of file ColumnInfo.php.

00184     {
00185         return $this->defaultValue;
00186     }

ColumnInfo::getName (  ) 

Get column name.

Returns:
string

Definition at line 127 of file ColumnInfo.php.

Referenced by TableInfo::addColumn().

00128     {
00129         return $this->name;
00130     }

ColumnInfo::getNativeType (  ) 

Gets the native type name.

Returns:
string

Definition at line 145 of file ColumnInfo.php.

00146     {
00147         return $this->nativeType;
00148     }

ColumnInfo::getPrecision (  ) 

Get column precision.

Returns:
int

Definition at line 163 of file ColumnInfo.php.

00164     {
00165         return $this->precision;
00166     }

ColumnInfo::getScale (  ) 

Get column scale.

Scale refers to number of digits after the decimal. Sometimes this is referred to as precision, but precision is the total number of digits (i.e. length).

Returns:
int

Definition at line 174 of file ColumnInfo.php.

00175     {
00176         return $this->scale;
00177     }

ColumnInfo::getSize (  ) 

Get column size.

Returns:
int

Definition at line 154 of file ColumnInfo.php.

00155     {
00156         return $this->size;
00157     }

ColumnInfo::getTable (  ) 

Get parent table.

Returns:
TableInfo

Definition at line 227 of file ColumnInfo.php.

00228     {
00229         return $this->table;
00230     }

ColumnInfo::getType (  ) 

Get column type.

Returns:
int

Definition at line 136 of file ColumnInfo.php.

00137     {
00138         return $this->type;
00139     }

ColumnInfo::getVendorSpecificInfo (  ) 

Get vendor specific optional information for this column.

Returns:
array vendorSpecificInfo[]

Definition at line 210 of file ColumnInfo.php.

00211     {
00212         return $this->vendorSpecificInfo;
00213     }

ColumnInfo::isAutoIncrement (  ) 

Is column of autoincrement type?

Returns:
boolean

Definition at line 201 of file ColumnInfo.php.

Referenced by __construct().

00202     {
00203         return $this->isAutoIncrement === true;
00204     }

ColumnInfo::isNullable (  ) 

Is column nullable?

Returns:
boolean

Definition at line 192 of file ColumnInfo.php.

Referenced by __construct().

00193     {
00194         return $this->isNullable;
00195     }

ColumnInfo::toString (  ) 

Returns:
string

Definition at line 218 of file ColumnInfo.php.

00219     {
00220         return $this->name;
00221     }


Member Data Documentation

ColumnInfo::$defaultValue

Default value.

Definition at line 59 of file ColumnInfo.php.

ColumnInfo::$isAutoIncrement

Is autoincrement?

Definition at line 62 of file ColumnInfo.php.

ColumnInfo::$isNullable

Is nullable?

Definition at line 56 of file ColumnInfo.php.

ColumnInfo::$name

Column name.

Definition at line 38 of file ColumnInfo.php.

Referenced by __construct().

ColumnInfo::$nativeType

Column native type.

Definition at line 44 of file ColumnInfo.php.

Referenced by __construct().

ColumnInfo::$precision

Column presision.

Definition at line 50 of file ColumnInfo.php.

Referenced by __construct().

ColumnInfo::$scale

Column scale (number of digits after decimal ).

Definition at line 53 of file ColumnInfo.php.

Referenced by __construct().

ColumnInfo::$size

Column length.

Definition at line 47 of file ColumnInfo.php.

Referenced by __construct().

ColumnInfo::$table

Table.

Definition at line 65 of file ColumnInfo.php.

ColumnInfo::$type

Column Creole type.

Definition at line 41 of file ColumnInfo.php.

Referenced by __construct().

ColumnInfo::$vendorSpecificInfo = array() [protected]

Definition at line 71 of file ColumnInfo.php.


The documentation for this class was generated from the following file:

Generated on Wed May 6 23:10:49 2009 for fareofficelib by  doxygen 1.5.8