Mysqli
2 years ago
Exception.php
2 years ago
Interface.php
2 years ago
Mysqli.php
1 year ago
Pdo.php
1 year ago
Interface.php
188 lines
| 1 | <?php |
| 2 | |
| 3 | namespace { |
| 4 | /** |
| 5 | * Zend Framework |
| 6 | * |
| 7 | * LICENSE |
| 8 | * |
| 9 | * This source file is subject to the new BSD license that is bundled |
| 10 | * with this package in the file LICENSE.txt. |
| 11 | * It is also available through the world-wide-web at this URL: |
| 12 | * http://framework.zend.com/license/new-bsd |
| 13 | * If you did not receive a copy of the license and are unable to |
| 14 | * obtain it through the world-wide-web, please send an email |
| 15 | * to license@zend.com so we can send you a copy immediately. |
| 16 | * |
| 17 | * @category Zend |
| 18 | * @package Zend_Db |
| 19 | * @subpackage Statement |
| 20 | * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) |
| 21 | * @license http://framework.zend.com/license/new-bsd New BSD License |
| 22 | * @version $Id: Interface.php 23775 2011-03-01 17:25:24Z ralph $ |
| 23 | */ |
| 24 | /** |
| 25 | * Emulates a PDOStatement for native database adapters. |
| 26 | * |
| 27 | * @category Zend |
| 28 | * @package Zend_Db |
| 29 | * @subpackage Statement |
| 30 | * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) |
| 31 | * @license http://framework.zend.com/license/new-bsd New BSD License |
| 32 | */ |
| 33 | interface Zend_Db_Statement_Interface |
| 34 | { |
| 35 | /** |
| 36 | * Bind a column of the statement result set to a PHP variable. |
| 37 | * |
| 38 | * @param string $column Name the column in the result set, either by |
| 39 | * position or by name. |
| 40 | * @param mixed $param Reference to the PHP variable containing the value. |
| 41 | * @param mixed $type OPTIONAL |
| 42 | * @return bool |
| 43 | * @throws Zend_Db_Statement_Exception |
| 44 | */ |
| 45 | public function bindColumn($column, &$param, $type = null); |
| 46 | /** |
| 47 | * Binds a parameter to the specified variable name. |
| 48 | * |
| 49 | * @param mixed $parameter Name the parameter, either integer or string. |
| 50 | * @param mixed $variable Reference to PHP variable containing the value. |
| 51 | * @param mixed $type OPTIONAL Datatype of SQL parameter. |
| 52 | * @param mixed $length OPTIONAL Length of SQL parameter. |
| 53 | * @param mixed $options OPTIONAL Other options. |
| 54 | * @return bool |
| 55 | * @throws Zend_Db_Statement_Exception |
| 56 | */ |
| 57 | public function bindParam($parameter, &$variable, $type = null, $length = null, $options = null); |
| 58 | /** |
| 59 | * Binds a value to a parameter. |
| 60 | * |
| 61 | * @param mixed $parameter Name the parameter, either integer or string. |
| 62 | * @param mixed $value Scalar value to bind to the parameter. |
| 63 | * @param mixed $type OPTIONAL Datatype of the parameter. |
| 64 | * @return bool |
| 65 | * @throws Zend_Db_Statement_Exception |
| 66 | */ |
| 67 | public function bindValue($parameter, $value, $type = null); |
| 68 | /** |
| 69 | * Closes the cursor, allowing the statement to be executed again. |
| 70 | * |
| 71 | * @return bool |
| 72 | * @throws Zend_Db_Statement_Exception |
| 73 | */ |
| 74 | public function closeCursor(); |
| 75 | /** |
| 76 | * Returns the number of columns in the result set. |
| 77 | * Returns null if the statement has no result set metadata. |
| 78 | * |
| 79 | * @return int The number of columns. |
| 80 | * @throws Zend_Db_Statement_Exception |
| 81 | */ |
| 82 | public function columnCount(); |
| 83 | /** |
| 84 | * Retrieves the error code, if any, associated with the last operation on |
| 85 | * the statement handle. |
| 86 | * |
| 87 | * @return string error code. |
| 88 | * @throws Zend_Db_Statement_Exception |
| 89 | */ |
| 90 | public function errorCode(); |
| 91 | /** |
| 92 | * Retrieves an array of error information, if any, associated with the |
| 93 | * last operation on the statement handle. |
| 94 | * |
| 95 | * @return array |
| 96 | * @throws Zend_Db_Statement_Exception |
| 97 | */ |
| 98 | public function errorInfo(); |
| 99 | /** |
| 100 | * Executes a prepared statement. |
| 101 | * |
| 102 | * @param array $params OPTIONAL Values to bind to parameter placeholders. |
| 103 | * @return bool |
| 104 | * @throws Zend_Db_Statement_Exception |
| 105 | */ |
| 106 | public function execute(array $params = array()); |
| 107 | /** |
| 108 | * Fetches a row from the result set. |
| 109 | * |
| 110 | * @param int $style OPTIONAL Fetch mode for this fetch operation. |
| 111 | * @param int $cursor OPTIONAL Absolute, relative, or other. |
| 112 | * @param int $offset OPTIONAL Number for absolute or relative cursors. |
| 113 | * @return mixed Array, object, or scalar depending on fetch mode. |
| 114 | * @throws Zend_Db_Statement_Exception |
| 115 | */ |
| 116 | public function fetch($style = null, $cursor = null, $offset = null); |
| 117 | /** |
| 118 | * Returns an array containing all of the result set rows. |
| 119 | * |
| 120 | * @param int $style OPTIONAL Fetch mode. |
| 121 | * @param int $col OPTIONAL Column number, if fetch mode is by column. |
| 122 | * @return array Collection of rows, each in a format by the fetch mode. |
| 123 | * @throws Zend_Db_Statement_Exception |
| 124 | */ |
| 125 | public function fetchAll($style = null, $col = null); |
| 126 | /** |
| 127 | * Returns a single column from the next row of a result set. |
| 128 | * |
| 129 | * @param int $col OPTIONAL Position of the column to fetch. |
| 130 | * @return string |
| 131 | * @throws Zend_Db_Statement_Exception |
| 132 | */ |
| 133 | public function fetchColumn($col = 0); |
| 134 | /** |
| 135 | * Fetches the next row and returns it as an object. |
| 136 | * |
| 137 | * @param string $class OPTIONAL Name of the class to create. |
| 138 | * @param array $config OPTIONAL Constructor arguments for the class. |
| 139 | * @return mixed One object instance of the specified class. |
| 140 | * @throws Zend_Db_Statement_Exception |
| 141 | */ |
| 142 | public function fetchObject($class = 'stdClass', array $config = array()); |
| 143 | /** |
| 144 | * Retrieve a statement attribute. |
| 145 | * |
| 146 | * @param string $key Attribute name. |
| 147 | * @return mixed Attribute value. |
| 148 | * @throws Zend_Db_Statement_Exception |
| 149 | */ |
| 150 | public function getAttribute($key); |
| 151 | /** |
| 152 | * Retrieves the next rowset (result set) for a SQL statement that has |
| 153 | * multiple result sets. An example is a stored procedure that returns |
| 154 | * the results of multiple queries. |
| 155 | * |
| 156 | * @return bool |
| 157 | * @throws Zend_Db_Statement_Exception |
| 158 | */ |
| 159 | public function nextRowset(); |
| 160 | /** |
| 161 | * Returns the number of rows affected by the execution of the |
| 162 | * last INSERT, DELETE, or UPDATE statement executed by this |
| 163 | * statement object. |
| 164 | * |
| 165 | * @return int The number of rows affected. |
| 166 | * @throws Zend_Db_Statement_Exception |
| 167 | */ |
| 168 | public function rowCount(); |
| 169 | /** |
| 170 | * Set a statement attribute. |
| 171 | * |
| 172 | * @param string $key Attribute name. |
| 173 | * @param mixed $val Attribute value. |
| 174 | * @return bool |
| 175 | * @throws Zend_Db_Statement_Exception |
| 176 | */ |
| 177 | public function setAttribute($key, $val); |
| 178 | /** |
| 179 | * Set the default fetch mode for this statement. |
| 180 | * |
| 181 | * @param int $mode The fetch mode. |
| 182 | * @return bool |
| 183 | * @throws Zend_Db_Statement_Exception |
| 184 | */ |
| 185 | public function setFetchMode($mode); |
| 186 | } |
| 187 | } |
| 188 |