KeyDef.php

Go to the documentation of this file.
00001 <?php 00002 00003 /* 00004 * $Id: KeyDef.php,v 1.1 2004/05/21 10:20:36 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 * This product includes software based on the Village framework, 00023 * http://share.whichever.com/index.php?SCREEN=village. 00024 */ 00025 00061 class KeyDef 00062 { 00064 var $cols; 00065 00067 var $size; 00068 00079 function KeyDef() 00080 { 00081 $this->cols = func_get_args(); 00082 $this->size = count($this->cols); 00083 } 00084 00090 function & addAttrib($name) 00091 { 00092 $this->cols[] = $name; 00093 $this->size++; 00094 return $this; 00095 } 00096 00102 function containsAttrib($name) 00103 { 00104 return in_array($name, $this->cols, true); 00105 } 00106 00112 function getAttrib($pos) 00113 { 00114 if ($pos === 0) $pos = 1; 00115 return @$this->cols[$pos - 1]; 00116 } 00117 00123 function size() 00124 { 00125 return $this->size; 00126 } 00127 00128 }

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


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS