Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / lib / Doctrine / DBAL / Driver / Statement.php
1 <?php
2 /*
3  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14  *
15  * This software consists of voluntary contributions made by many individuals
16  * and is licensed under the MIT license. For more information, see
17  * <http://www.doctrine-project.org>.
18  */
19
20 namespace Doctrine\DBAL\Driver;
21
22 use \PDO;
23
24 /**
25  * Statement interface.
26  * Drivers must implement this interface.
27  *
28  * This resembles (a subset of) the PDOStatement interface.
29  *
30  * @author      Konsta Vesterinen <kvesteri@cc.hut.fi>
31  * @author      Roman Borschel <roman@code-factory.org>
32  * @license     http://www.opensource.org/licenses/lgpl-license.php LGPL
33  * @link        www.doctrine-project.org
34  * @since       2.0
35  */
36 interface Statement extends ResultStatement
37 {
38     /**
39      * Binds a value to a corresponding named or positional
40      * placeholder in the SQL statement that was used to prepare the statement.
41      *
42      * @param mixed $param          Parameter identifier. For a prepared statement using named placeholders,
43      *                              this will be a parameter name of the form :name. For a prepared statement
44      *                              using question mark placeholders, this will be the 1-indexed position of the parameter
45      *
46      * @param mixed $value          The value to bind to the parameter.
47      * @param integer $type         Explicit data type for the parameter using the PDO::PARAM_* constants.
48      *
49      * @return boolean              Returns TRUE on success or FALSE on failure.
50      */
51     function bindValue($param, $value, $type = null);
52
53     /**
54      * Binds a PHP variable to a corresponding named or question mark placeholder in the
55      * SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(),
56      * the variable is bound as a reference and will only be evaluated at the time
57      * that PDOStatement->execute() is called.
58      *
59      * Most parameters are input parameters, that is, parameters that are
60      * used in a read-only fashion to build up the query. Some drivers support the invocation
61      * of stored procedures that return data as output parameters, and some also as input/output
62      * parameters that both send in data and are updated to receive it.
63      *
64      * @param mixed $column         Parameter identifier. For a prepared statement using named placeholders,
65      *                              this will be a parameter name of the form :name. For a prepared statement
66      *                              using question mark placeholders, this will be the 1-indexed position of the parameter
67      *
68      * @param mixed $variable       Name of the PHP variable to bind to the SQL statement parameter.
69      *
70      * @param integer $type         Explicit data type for the parameter using the PDO::PARAM_* constants. To return
71      *                              an INOUT parameter from a stored procedure, use the bitwise OR operator to set the
72      *                              PDO::PARAM_INPUT_OUTPUT bits for the data_type parameter.
73      * @param integer $length           You must specify maxlength when using an OUT bind so that PHP allocates enough memory to hold the returned value.
74      * @return boolean              Returns TRUE on success or FALSE on failure.
75      */
76     function bindParam($column, &$variable, $type = null, $length = null);
77
78     /**
79      * errorCode
80      * Fetch the SQLSTATE associated with the last operation on the statement handle
81      *
82      * @see Doctrine_Adapter_Interface::errorCode()
83      * @return string       error code string
84      */
85     function errorCode();
86
87     /**
88      * errorInfo
89      * Fetch extended error information associated with the last operation on the statement handle
90      *
91      * @see Doctrine_Adapter_Interface::errorInfo()
92      * @return array        error info array
93      */
94     function errorInfo();
95
96     /**
97      * Executes a prepared statement
98      *
99      * If the prepared statement included parameter markers, you must either:
100      * call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
101      * bound variables pass their value as input and receive the output value,
102      * if any, of their associated parameter markers or pass an array of input-only
103      * parameter values
104      *
105      *
106      * @param array $params             An array of values with as many elements as there are
107      *                                  bound parameters in the SQL statement being executed.
108      * @return boolean                  Returns TRUE on success or FALSE on failure.
109      */
110     function execute($params = null);
111
112     /**
113      * rowCount
114      * rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
115      * executed by the corresponding object.
116      *
117      * If the last SQL statement executed by the associated Statement object was a SELECT statement,
118      * some databases may return the number of rows returned by that statement. However,
119      * this behaviour is not guaranteed for all databases and should not be
120      * relied on for portable applications.
121      *
122      * @return integer                      Returns the number of rows.
123      */
124     function rowCount();
125 }