ColumnInfo.php

Go to the documentation of this file.
00001 <?php 00002 00003 /* 00004 * $Id: ColumnInfo.php,v 1.10 2004/03/20 04:16:50 hlellelid Exp $ 00005 * 00006 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00007 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00008 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 00009 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 00010 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 00011 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 00012 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00013 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00014 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00015 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00016 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00017 * 00018 * This software consists of voluntary contributions made by many individuals 00019 * and is licensed under the LGPL. For more information please see 00020 * <http://creole.phpdb.org>. 00021 */ 00022 00023 /* 00024 * Represents a Column. 00025 * 00026 * @author Hans Lellelid <hans@xmpl.org> 00027 * @package creole.metadata 00028 * @version $Revision: 1.10 $ 00029 */ 00030 class ColumnInfo { 00031 00032 // FIXME 00033 // - Currently all member attributes are public. This should be fixed 00034 // when PHP's magic __sleep() and __wakeup() functions & serialization support 00035 // handles protected/private members. (if ever) 00036 00038 public $name; 00039 00041 public $type; 00042 00044 public $nativeType; 00045 00047 public $size; 00048 00050 public $scale; 00051 00053 public $isNullable; 00054 00056 public $defaultValue; 00057 00059 public $table; 00060 00073 function __construct(TableInfo $table, $name, $type = null, $nativeType = null, $size = null, $scale = null, $is_nullable = null, $default = null) 00074 { 00075 $this->table = $table; 00076 $this->name = $name; 00077 $this->type = $type; 00078 $this->nativeType = $nativeType; 00079 $this->size = $size; 00080 $this->scale = $scale; 00081 $this->isNullable = $is_nullable; 00082 $this->defaultValue = $default; 00083 } 00084 00091 function __sleep() 00092 { 00093 return array('name', 'type', 'nativeType', 'size', 'precision', 'isNullable', 'defaultValue'); 00094 } 00095 00100 public function getName() 00101 { 00102 return $this->name; 00103 } 00104 00109 public function getType() 00110 { 00111 return $this->type; 00112 } 00113 00118 public function getNativeType() 00119 { 00120 return $this->nativeType; 00121 } 00122 00127 public function getSize() 00128 { 00129 return $this->size; 00130 } 00131 00138 public function getScale() 00139 { 00140 return $this->scale; 00141 } 00142 00147 public function getDefaultValue() 00148 { 00149 return $this->defaultValue; 00150 } 00151 00156 public function isNullable() 00157 { 00158 return $this->isNullable; 00159 } 00160 00164 public function toString() 00165 { 00166 return $this->name; 00167 } 00168 00173 public function getTable() 00174 { 00175 return $this->table; 00176 } 00177 00178 }

This file is part of the Creole[php5] library.


Copyright © 2004 Hans Lellelid  
Creole[php5] CVS