Rajout de doctrine/orm
[zf2.biz/galerie.git] / vendor / doctrine / dbal / lib / Doctrine / DBAL / Driver / ResultStatement.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  * Interface for the reading part of a prepare statement only.
26  *
27  * @author Benjamin Eberlei <kontakt@beberlei.de>
28  */
29 interface ResultStatement extends \Traversable
30 {
31     /**
32      * Closes the cursor, enabling the statement to be executed again.
33      *
34      * @return boolean              Returns TRUE on success or FALSE on failure.
35      */
36     function closeCursor();
37
38
39     /**
40      * columnCount
41      * Returns the number of columns in the result set
42      *
43      * @return integer              Returns the number of columns in the result set represented
44      *                              by the PDOStatement object. If there is no result set,
45      *                              this method should return 0.
46      */
47     function columnCount();
48
49     /**
50      * setFetchMode
51      * Set the fetch mode to use while iterating this statement.
52      *
53      * @param integer $fetchMode
54      */
55     function setFetchMode($fetchMode, $arg2 = null, $arg3 = null);
56
57     /**
58      * fetch
59      *
60      * @see Query::HYDRATE_* constants
61      * @param integer $fetchMode            Controls how the next row will be returned to the caller.
62      *                                      This value must be one of the Query::HYDRATE_* constants,
63      *                                      defaulting to Query::HYDRATE_BOTH
64      *
65      * @return mixed
66      */
67     function fetch($fetchMode = null);
68
69     /**
70      * Returns an array containing all of the result set rows
71      *
72      * @param integer $fetchMode            Controls how the next row will be returned to the caller.
73      *                                      This value must be one of the Query::HYDRATE_* constants,
74      *                                      defaulting to Query::HYDRATE_BOTH
75      *
76      * @return array
77      */
78     function fetchAll($fetchMode = null);
79
80     /**
81      * fetchColumn
82      * Returns a single column from the next row of a
83      * result set or FALSE if there are no more rows.
84      *
85      * @param integer $columnIndex          0-indexed number of the column you wish to retrieve from the row. If no
86      *                                      value is supplied, PDOStatement->fetchColumn()
87      *                                      fetches the first column.
88      *
89      * @return string                       returns a single column in the next row of a result set.
90      */
91     function fetchColumn($columnIndex = 0);
92 }
93