ColumnInfo.php

Go to the documentation of this file.
00001 <?php 00002 00003 /* 00004 * $Id: ColumnInfo.php,v 1.2 2004/05/09 21:20:23 micha 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 * @author Michael Aichler <aichler@mediacluster.de 00028 * @package creole.metadata 00029 * @version $Revision: 1.2 $ 00030 */ 00031 class ColumnInfo 00032 { 00034 var $name; 00035 00037 var $type; 00038 00040 var $nativeType; 00041 00043 var $size; 00044 00046 var $scale; 00047 00049 var $isNullable; 00050 00052 var $defaultValue; 00053 00055 var $table; 00056 00069 function ColumnInfo(/*TableInfo*/ &$table, $name, $type = null, $nativeType = null, $size = null, $scale = null, $is_nullable = null, $default = null) 00070 { 00071 if (! is_a($table, 'TableInfo')) { 00072 trigger_error( 00073 "ColumnInfo::ColumnInfo(): parameter 1 not of type 'TableInfo' !", 00074 E_USER_ERROR 00075 ); 00076 } 00077 00078 $this->table =& $table; 00079 $this->name = $name; 00080 $this->type = $type; 00081 $this->nativeType = $nativeType; 00082 $this->size = $size; 00083 $this->scale = $scale; 00084 $this->isNullable = $is_nullable; 00085 $this->defaultValue = $default; 00086 } 00087 00094 function __sleep() 00095 { 00096 return array('name', 'type', 'nativeType', 'size', 'precision', 'isNullable', 'defaultValue'); 00097 } 00098 00103 function getName() 00104 { 00105 return $this->name; 00106 } 00107 00112 function getType() 00113 { 00114 return $this->type; 00115 } 00116 00121 function getNativeType() 00122 { 00123 return $this->nativeType; 00124 } 00125 00130 function getSize() 00131 { 00132 return $this->size; 00133 } 00134 00141 function getScale() 00142 { 00143 return $this->scale; 00144 } 00145 00150 function getDefaultValue() 00151 { 00152 return $this->defaultValue; 00153 } 00154 00159 function isNullable() 00160 { 00161 return $this->isNullable; 00162 } 00163 00167 function toString() 00168 { 00169 return $this->name; 00170 } 00171 00176 function & getTable() 00177 { 00178 return $this->table; 00179 } 00180 00181 }

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


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS