[ Index ] |
PHP Cross Reference of Web Application Component Toolkit |
[Summary view] [Print] [Text view]
1 <?php 2 //-------------------------------------------------------------------------------- 3 // Copyright 2003 Procata, Inc. 4 // Released under the LGPL license (http://www.gnu.org/copyleft/lesser.html) 5 //-------------------------------------------------------------------------------- 6 /** 7 * @package WACT_DB 8 * @version $Id: connection.inc.php,v 1.1 2004/05/24 20:16:04 jeffmoore Exp $ 9 */ 10 //-------------------------------------------------------------------------------- 11 12 /** 13 * Represents a database connection 14 * @see http://wact.sourceforge.net/index.php/Connection 15 * @package WACT_DB 16 */ 17 interface Connection { 18 19 /** 20 * Convert a PHP value into an SQL literal. The type to convert to is 21 * based on the type of the PHP value passed, or the type string passed. 22 * @param mixed value to convert 23 * @param string (optional) type to convert to 24 * @return string literal SQL fragment 25 */ 26 function makeLiteral($value, $type = NULL); 27 28 /** 29 * Factory function to create a Record object 30 * @see http://wact.sourceforge.net/index.php/NewRecord 31 * @param DataSpace or subclass (optional) 32 * used to initialize the fields of the new record prior to calling insert() 33 * @return Record reference 34 */ 35 function &NewRecord($DataSpace = NULL); 36 37 /** 38 * Factory function used to retrieve more than one row from a MySQL database, 39 * applying a filter to the data if supplied as an argument 40 * @see http://wact.sourceforge.net/index.php/NewRecordSet 41 * @param string SQL statement 42 * @param object filter class (optional) 43 * @return RecordSet reference 44 */ 45 function &NewRecordSet($query, $filter = NULL); 46 47 /** 48 * Factory function used to retrieve more than one row from a MySQL database, 49 * applying a filter to the data if supplied as an argument, and applying a 50 * pager to the result set as well. 51 * @param string SQL statement 52 * @param object pager 53 * @param object filter class (optional) 54 * @return RecordSet reference 55 */ 56 function &NewPagedRecordSet($query, &$pager, $filter = NULL); 57 58 /** 59 * Retreive a single record from the database based on a query. 60 * @param string SQL Query 61 * @return Record object or NULL if not found 62 */ 63 function &FindRecord($query); 64 65 /** 66 * Get a single value from the first column of a single record from 67 * a database query. 68 * @param string SQL Query 69 * @return Value or NULL if not found 70 * @access public 71 */ 72 function getOneValue($query); 73 74 /** 75 * Retreive an array where each element of the array is the value from the 76 * first column of a database query. 77 * @param string SQL Query 78 */ 79 function getOneColumnArray($query); 80 81 /** 82 * Retreive an associative array where each element of the array is based 83 * on the first column as a key and the second column as data. 84 * @param string SQL Query 85 */ 86 function getTwoColumnArray($query); 87 88 /** 89 * Performs any query that does not return a cursor. 90 * @param string SQL query 91 * @return boolean True if successful. 92 */ 93 function execute($sql); 94 95 /** 96 * Disconnect from database 97 * @return void 98 * @access public 99 */ 100 function disconnect(); 101 102 } 103 104 ?>
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 28 19:36:09 2004 | Cross-referenced by PHPXref 0.5 |