7
* This source file is subject to the new BSD license that is bundled
8
* with this package in the file LICENSE.txt.
9
* It is also available through the world-wide-web at this URL:
10
* http://framework.zend.com/license/new-bsd
11
* If you did not receive a copy of the license and are unable to
12
* obtain it through the world-wide-web, please send an email
13
* to license@zend.com so we can send you a copy immediately.
17
* @subpackage Statement
18
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
19
* @license http://framework.zend.com/license/new-bsd New BSD License
23
* Emulates a PDOStatement for native database adapters.
27
* @subpackage Statement
28
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
29
* @license http://framework.zend.com/license/new-bsd New BSD License
31
interface Zend_Db_Statement_Interface
35
* Bind a column of the statement result set to a PHP variable.
37
* @param string $column Name the column in the result set, either by
38
* position or by name.
39
* @param mixed $param Reference to the PHP variable containing the value.
40
* @param mixed $type OPTIONAL
42
* @throws Zend_Db_Statement_Exception
44
public function bindColumn($column, &$param, $type = null);
47
* Binds a parameter to the specified variable name.
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.
55
* @throws Zend_Db_Statement_Exception
57
public function bindParam($parameter, &$variable, $type = null, $length = null, $options = null);
60
* Binds a value to a parameter.
62
* @param mixed $parameter Name the parameter, either integer or string.
63
* @param mixed $value Scalar value to bind to the parameter.
64
* @param mixed $type OPTIONAL Datatype of the parameter.
66
* @throws Zend_Db_Statement_Exception
68
public function bindValue($parameter, $value, $type = null);
71
* Closes the cursor, allowing the statement to be executed again.
74
* @throws Zend_Db_Statement_Exception
76
public function closeCursor();
79
* Returns the number of columns in the result set.
80
* Returns null if the statement has no result set metadata.
82
* @return int The number of columns.
83
* @throws Zend_Db_Statement_Exception
85
public function columnCount();
88
* Retrieves the error code, if any, associated with the last operation on
89
* the statement handle.
91
* @return string error code.
92
* @throws Zend_Db_Statement_Exception
94
public function errorCode();
97
* Retrieves an array of error information, if any, associated with the
98
* last operation on the statement handle.
101
* @throws Zend_Db_Statement_Exception
103
public function errorInfo();
106
* Executes a prepared statement.
108
* @param array $params OPTIONAL Values to bind to parameter placeholders.
110
* @throws Zend_Db_Statement_Exception
112
public function execute(array $params = array());
115
* Fetches a row from the result set.
117
* @param int $style OPTIONAL Fetch mode for this fetch operation.
118
* @param int $cursor OPTIONAL Absolute, relative, or other.
119
* @param int $offset OPTIONAL Number for absolute or relative cursors.
120
* @return mixed Array, object, or scalar depending on fetch mode.
121
* @throws Zend_Db_Statement_Exception
123
public function fetch($style = null, $cursor = null, $offset = null);
126
* Returns an array containing all of the result set rows.
128
* @param int $style OPTIONAL Fetch mode.
129
* @param int $col OPTIONAL Column number, if fetch mode is by column.
130
* @return array Collection of rows, each in a format by the fetch mode.
131
* @throws Zend_Db_Statement_Exception
133
public function fetchAll($style = null, $col = null);
136
* Returns a single column from the next row of a result set.
138
* @param int $col OPTIONAL Position of the column to fetch.
140
* @throws Zend_Db_Statement_Exception
142
public function fetchColumn($col = 0);
145
* Fetches the next row and returns it as an object.
147
* @param string $class OPTIONAL Name of the class to create.
148
* @param array $config OPTIONAL Constructor arguments for the class.
149
* @return mixed One object instance of the specified class.
150
* @throws Zend_Db_Statement_Exception
152
public function fetchObject($class = 'stdClass', array $config = array());
155
* Retrieve a statement attribute.
157
* @param string $key Attribute name.
158
* @return mixed Attribute value.
159
* @throws Zend_Db_Statement_Exception
161
public function getAttribute($key);
164
* Retrieves the next rowset (result set) for a SQL statement that has
165
* multiple result sets. An example is a stored procedure that returns
166
* the results of multiple queries.
169
* @throws Zend_Db_Statement_Exception
171
public function nextRowset();
174
* Returns the number of rows affected by the execution of the
175
* last INSERT, DELETE, or UPDATE statement executed by this
178
* @return int The number of rows affected.
179
* @throws Zend_Db_Statement_Exception
181
public function rowCount();
184
* Set a statement attribute.
186
* @param string $key Attribute name.
187
* @param mixed $val Attribute value.
189
* @throws Zend_Db_Statement_Exception
191
public function setAttribute($key, $val);
194
* Set the default fetch mode for this statement.
196
* @param int $mode The fetch mode.
198
* @throws Zend_Db_Statement_Exception
200
public function setFetchMode($mode);