~chroot64bit/zivios/gentoo-experimental

« back to all changes in this revision

Viewing changes to application/library/Zend/Db/Statement/Interface.php

  • Committer: Mustafa A. Hashmi
  • Date: 2008-12-04 13:32:21 UTC
  • Revision ID: mhashmi@zivios.org-20081204133221-0nd1trunwevijj38
Inclusion of new installation framework with ties to zend layout and dojo layout

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/**
 
3
 * Zend Framework
 
4
 *
 
5
 * LICENSE
 
6
 *
 
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.
 
14
 *
 
15
 * @category   Zend
 
16
 * @package    Zend_Db
 
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
 
20
 */
 
21
 
 
22
/**
 
23
 * Emulates a PDOStatement for native database adapters.
 
24
 *
 
25
 * @category   Zend
 
26
 * @package    Zend_Db
 
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
 
30
 */
 
31
interface Zend_Db_Statement_Interface
 
32
{
 
33
 
 
34
    /**
 
35
     * Bind a column of the statement result set to a PHP variable.
 
36
     *
 
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
 
41
     * @return bool
 
42
     * @throws Zend_Db_Statement_Exception
 
43
     */
 
44
    public function bindColumn($column, &$param, $type = null);
 
45
 
 
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
    /**
 
60
     * Binds a value to a parameter.
 
61
     *
 
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.
 
65
     * @return bool
 
66
     * @throws Zend_Db_Statement_Exception
 
67
     */
 
68
    public function bindValue($parameter, $value, $type = null);
 
69
 
 
70
    /**
 
71
     * Closes the cursor, allowing the statement to be executed again.
 
72
     *
 
73
     * @return bool
 
74
     * @throws Zend_Db_Statement_Exception
 
75
     */
 
76
    public function closeCursor();
 
77
 
 
78
    /**
 
79
     * Returns the number of columns in the result set.
 
80
     * Returns null if the statement has no result set metadata.
 
81
     *
 
82
     * @return int The number of columns.
 
83
     * @throws Zend_Db_Statement_Exception
 
84
     */
 
85
    public function columnCount();
 
86
 
 
87
    /**
 
88
     * Retrieves the error code, if any, associated with the last operation on
 
89
     * the statement handle.
 
90
     *
 
91
     * @return string error code.
 
92
     * @throws Zend_Db_Statement_Exception
 
93
     */
 
94
    public function errorCode();
 
95
 
 
96
    /**
 
97
     * Retrieves an array of error information, if any, associated with the
 
98
     * last operation on the statement handle.
 
99
     *
 
100
     * @return array
 
101
     * @throws Zend_Db_Statement_Exception
 
102
     */
 
103
    public function errorInfo();
 
104
 
 
105
    /**
 
106
     * Executes a prepared statement.
 
107
     *
 
108
     * @param array $params OPTIONAL Values to bind to parameter placeholders.
 
109
     * @return bool
 
110
     * @throws Zend_Db_Statement_Exception
 
111
     */
 
112
    public function execute(array $params = array());
 
113
 
 
114
    /**
 
115
     * Fetches a row from the result set.
 
116
     *
 
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
 
122
     */
 
123
    public function fetch($style = null, $cursor = null, $offset = null);
 
124
 
 
125
    /**
 
126
     * Returns an array containing all of the result set rows.
 
127
     *
 
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
 
132
     */
 
133
    public function fetchAll($style = null, $col = null);
 
134
 
 
135
    /**
 
136
     * Returns a single column from the next row of a result set.
 
137
     *
 
138
     * @param int $col OPTIONAL Position of the column to fetch.
 
139
     * @return string
 
140
     * @throws Zend_Db_Statement_Exception
 
141
     */
 
142
    public function fetchColumn($col = 0);
 
143
 
 
144
    /**
 
145
     * Fetches the next row and returns it as an object.
 
146
     *
 
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
 
151
     */
 
152
    public function fetchObject($class = 'stdClass', array $config = array());
 
153
 
 
154
    /**
 
155
     * Retrieve a statement attribute.
 
156
     *
 
157
     * @param string $key Attribute name.
 
158
     * @return mixed      Attribute value.
 
159
     * @throws Zend_Db_Statement_Exception
 
160
     */
 
161
    public function getAttribute($key);
 
162
 
 
163
    /**
 
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.
 
167
     *
 
168
     * @return bool
 
169
     * @throws Zend_Db_Statement_Exception
 
170
     */
 
171
    public function nextRowset();
 
172
 
 
173
    /**
 
174
     * Returns the number of rows affected by the execution of the
 
175
     * last INSERT, DELETE, or UPDATE statement executed by this
 
176
     * statement object.
 
177
     *
 
178
     * @return int     The number of rows affected.
 
179
     * @throws Zend_Db_Statement_Exception
 
180
     */
 
181
    public function rowCount();
 
182
 
 
183
    /**
 
184
     * Set a statement attribute.
 
185
     *
 
186
     * @param string $key Attribute name.
 
187
     * @param mixed  $val Attribute value.
 
188
     * @return bool
 
189
     * @throws Zend_Db_Statement_Exception
 
190
     */
 
191
    public function setAttribute($key, $val);
 
192
 
 
193
    /**
 
194
     * Set the default fetch mode for this statement.
 
195
     *
 
196
     * @param int   $mode The fetch mode.
 
197
     * @return bool
 
198
     * @throws Zend_Db_Statement_Exception
 
199
     */
 
200
    public function setFetchMode($mode);
 
201
 
 
202
}