ForeignKeyInfo.php

Go to the documentation of this file.
00001 <?php 00002 00003 /* 00004 * $Id: ForeignKeyInfo.php,v 1.1 2004/03/25 22:59:41 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 // STATUS: 00025 // - ported: y 00026 // - compiled: y 00027 // - tested: n 00028 // 00029 00037 class ForeignKeyInfo 00038 { 00039 00040 var $name; 00041 var $references = array(); 00042 00046 function ForeignKeyInfo($name) 00047 { 00048 $this->name = $name; 00049 } 00050 00055 function getName() 00056 { 00057 return $this->name; 00058 } 00059 00065 function addReference(/*ColumnInfo*/ &$local, /*ColumnInfo*/ &$foreign) 00066 { 00067 if (! is_a($local, 'ColumnInfo')) { 00068 trigger_error( 00069 "ForeignKeyInfo::addReference(): parameter 1 not of type 'ColumnInfo' !", 00070 E_USER_ERROR 00071 ); 00072 } 00073 else if (! is_a($foreign, 'ColumnInfo')) { 00074 trigger_error( 00075 "ForeignKeyInfo::addReference(): parameter 2 not of type 'ColumnInfo' !", 00076 E_USER_ERROR 00077 ); 00078 } 00079 $ref[] =& $local; 00080 $ref[] =& $foreign; 00081 $this->references[] =& $ref; 00082 } 00083 00088 function & getReferences() 00089 { 00090 return $this->references; 00091 } 00092 00096 function toString() 00097 { 00098 return $this->name; 00099 } 00100 00101 }

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


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS