1
0
mirror of synced 2024-12-16 08:06:02 +03:00
doctrine2/lib/api/doctrine/dbal/driver/statement.html
2010-04-14 17:13:14 +02:00

331 lines
15 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta name="generator" content="PHPDoctor 2RC4 (http://phpdoctor.sourceforge.net/)">
<meta name="when" content="Wed, 14 Apr 2010 15:12:04 +0000">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css">
<link rel="start" href="../../../overview-summary.html">
<title>Statement (Doctrine)</title>
</head>
<body id="definition" onload="parent.document.title=document.title;">
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/dbal/driver/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/dbal/driver/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/dbal/driver/statement.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<div class="qualifiedName">Doctrine\DBAL\Driver\Statement</div>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 39</div>
<h1>Interface Statement</h1>
<pre class="tree"><strong>Statement</strong><br /></pre>
<hr>
<p class="signature">public interface <strong>Statement</strong></p>
<div class="comment" id="overview_description"><p>Statement interface.
Drivers must implement this interface.</p><p>This resembles (a subset of) the PDOStatement interface.</p></div>
<dl>
<dt>Author:</dt>
<dd>Konsta Vesterinen <kvesteri@cc.hut.fi></dd>
<dd>Roman Borschel <roman@code-factory.org></dd>
<dt>License:</dt>
<dd>http://www.opensource.org/licenses/lgpl-license.php LGPL</dd>
<dt>See Also:</dt>
<dd><code>www.doctrine-project.org</code></dd>
<dt>Since:</dt>
<dd>2.0</dd>
<dt>Version:</dt>
<dd>$Revision$</dd>
</dl>
<hr>
<table id="summary_method">
<tr><th colspan="2">Method Summary</th></tr>
<tr>
<td class="type"> boolean</td>
<td class="description"><p class="name"><a href="#bindParam()">bindParam</a>(mixed column, mixed variable, integer type, mixed param)</p><p class="description">Binds a PHP variable to a corresponding named or question mark placeholder in the
SQL statement that was use to prepare the statement. </p></td>
</tr>
<tr>
<td class="type"> boolean</td>
<td class="description"><p class="name"><a href="#bindValue()">bindValue</a>(mixed param, mixed value, integer type)</p><p class="description">Binds a value to a corresponding named or positional
placeholder in the SQL statement that was used to prepare the statement.</p></td>
</tr>
<tr>
<td class="type"> boolean</td>
<td class="description"><p class="name"><a href="#closeCursor()">closeCursor</a>()</p><p class="description">Closes the cursor, enabling the statement to be executed again.</p></td>
</tr>
<tr>
<td class="type"> integer</td>
<td class="description"><p class="name"><a href="#columnCount()">columnCount</a>()</p><p class="description">columnCount
Returns the number of columns in the result set</p></td>
</tr>
<tr>
<td class="type"> string</td>
<td class="description"><p class="name"><a href="#errorCode()">errorCode</a>()</p><p class="description">errorCode
Fetch the SQLSTATE associated with the last operation on the statement handle</p></td>
</tr>
<tr>
<td class="type"> array</td>
<td class="description"><p class="name"><a href="#errorInfo()">errorInfo</a>()</p><p class="description">errorInfo
Fetch extended error information associated with the last operation on the statement handle</p></td>
</tr>
<tr>
<td class="type"> boolean</td>
<td class="description"><p class="name"><a href="#execute()">execute</a>(array params)</p><p class="description">Executes a prepared statementIf the prepared statement included parameter markers, you must either:
call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
bound variables pass their value as input and receive the output value,
if any, of their associated parameter markers or pass an array of input-only
parameter values</p></td>
</tr>
<tr>
<td class="type"> mixed</td>
<td class="description"><p class="name"><a href="#fetch()">fetch</a>(integer fetchStyle, integer cursorOrientation, integer cursorOffset)</p><p class="description">fetch</p></td>
</tr>
<tr>
<td class="type"> array</td>
<td class="description"><p class="name"><a href="#fetchAll()">fetchAll</a>(integer fetchStyle, integer columnIndex)</p><p class="description">Returns an array containing all of the result set rows</p></td>
</tr>
<tr>
<td class="type"> string</td>
<td class="description"><p class="name"><a href="#fetchColumn()">fetchColumn</a>(integer columnIndex)</p><p class="description">fetchColumn
Returns a single column from the next row of a
result set or FALSE if there are no more rows.</p></td>
</tr>
<tr>
<td class="type"> integer</td>
<td class="description"><p class="name"><a href="#rowCount()">rowCount</a>()</p><p class="description">rowCount
rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
executed by the corresponding object.
</p></td>
</tr>
</table>
<h2 id="detail_method">Method Detail</h2>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 78</div>
<h3 id="bindParam()">bindParam</h3>
<code class="signature">public boolean <strong>bindParam</strong>(mixed column, mixed variable, integer type, mixed param)</code>
<div class="details">
<p>Binds a PHP variable to a corresponding named or question mark placeholder in the
SQL statement that was use to prepare the statement. Unlike PDOStatement->bindValue(),
the variable is bound as a reference and will only be evaluated at the time
that PDOStatement->execute() is called.</p><p>Most parameters are input parameters, that is, parameters that are
used in a read-only fashion to build up the query. Some drivers support the invocation
of stored procedures that return data as output parameters, and some also as input/output
parameters that both send in data and are updated to receive it.</p><dl>
<dt>Parameters:</dt>
<dd>param - Parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter</dd>
<dd>variable - Name of the PHP variable to bind to the SQL statement parameter.</dd>
<dd>type - Explicit data type for the parameter using the PDO::PARAM_* constants. To return an INOUT parameter from a stored procedure, use the bitwise OR operator to set the PDO::PARAM_INPUT_OUTPUT bits for the data_type parameter.</dd>
<dt>Returns:</dt>
<dd>Returns TRUE on success or FALSE on failure.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 54</div>
<h3 id="bindValue()">bindValue</h3>
<code class="signature">public boolean <strong>bindValue</strong>(mixed param, mixed value, integer type)</code>
<div class="details">
<p>Binds a value to a corresponding named or positional
placeholder in the SQL statement that was used to prepare the statement.</p><dl>
<dt>Parameters:</dt>
<dd>param - Parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form :name. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter</dd>
<dd>value - The value to bind to the parameter.</dd>
<dd>type - Explicit data type for the parameter using the PDO::PARAM_* constants.</dd>
<dt>Returns:</dt>
<dd>Returns TRUE on success or FALSE on failure.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 85</div>
<h3 id="closeCursor()">closeCursor</h3>
<code class="signature">public boolean <strong>closeCursor</strong>()</code>
<div class="details">
<p>Closes the cursor, enabling the statement to be executed again.</p><dl>
<dt>Returns:</dt>
<dd>Returns TRUE on success or FALSE on failure.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 95</div>
<h3 id="columnCount()">columnCount</h3>
<code class="signature">public integer <strong>columnCount</strong>()</code>
<div class="details">
<p>columnCount
Returns the number of columns in the result set</p><dl>
<dt>Returns:</dt>
<dd>Returns the number of columns in the result set represented by the PDOStatement object. If there is no result set, this method should return 0.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 104</div>
<h3 id="errorCode()">errorCode</h3>
<code class="signature">public string <strong>errorCode</strong>()</code>
<div class="details">
<p>errorCode
Fetch the SQLSTATE associated with the last operation on the statement handle</p><dl>
<dt>See Also:</dt>
<dd>Doctrine_Adapter_Interface::errorCode()</dd>
<dt>Returns:</dt>
<dd>error code string</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 113</div>
<h3 id="errorInfo()">errorInfo</h3>
<code class="signature">public array <strong>errorInfo</strong>()</code>
<div class="details">
<p>errorInfo
Fetch extended error information associated with the last operation on the statement handle</p><dl>
<dt>See Also:</dt>
<dd>Doctrine_Adapter_Interface::errorInfo()</dd>
<dt>Returns:</dt>
<dd>error info array</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 129</div>
<h3 id="execute()">execute</h3>
<code class="signature">public boolean <strong>execute</strong>(array params)</code>
<div class="details">
<p>Executes a prepared statement</p><p>If the prepared statement included parameter markers, you must either:
call PDOStatement->bindParam() to bind PHP variables to the parameter markers:
bound variables pass their value as input and receive the output value,
if any, of their associated parameter markers or pass an array of input-only
parameter values</p><dl>
<dt>Parameters:</dt>
<dd>params - An array of values with as many elements as there are bound parameters in the SQL statement being executed.</dd>
<dt>Returns:</dt>
<dd>Returns TRUE on success or FALSE on failure.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 158</div>
<h3 id="fetch()">fetch</h3>
<code class="signature">public mixed <strong>fetch</strong>(integer fetchStyle, integer cursorOrientation, integer cursorOffset)</code>
<div class="details">
<p>fetch</p><dl>
<dt>See Also:</dt>
<dd>constants</dd>
<dt>Parameters:</dt>
<dd>fetchStyle - Controls how the next row will be returned to the caller. This value must be one of the Query::HYDRATE_* constants, defaulting to Query::HYDRATE_BOTH</dd>
<dd>cursorOrientation - For a PDOStatement object representing a scrollable cursor, this value determines which row will be returned to the caller. This value must be one of the Query::HYDRATE_ORI_* constants, defaulting to Query::HYDRATE_ORI_NEXT. To request a scrollable cursor for your PDOStatement object, you must set the PDO::ATTR_CURSOR attribute to Doctrine::CURSOR_SCROLL when you prepare the SQL statement with Doctrine_Adapter_Interface->prepare().</dd>
<dd>cursorOffset - For a PDOStatement object representing a scrollable cursor for which the $cursorOrientation parameter is set to Query::HYDRATE_ORI_ABS, this value specifies the absolute number of the row in the result set that shall be fetched. For a PDOStatement object representing a scrollable cursor for which the $cursorOrientation parameter is set to Query::HYDRATE_ORI_REL, this value specifies the row to fetch relative to the cursor position before PDOStatement->fetch() was called.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 172</div>
<h3 id="fetchAll()">fetchAll</h3>
<code class="signature">public array <strong>fetchAll</strong>(integer fetchStyle, integer columnIndex)</code>
<div class="details">
<p>Returns an array containing all of the result set rows</p><dl>
<dt>Parameters:</dt>
<dd>fetchStyle - Controls how the next row will be returned to the caller. This value must be one of the Query::HYDRATE_* constants, defaulting to Query::HYDRATE_BOTH</dd>
<dd>columnIndex - Returns the indicated 0-indexed column when the value of $fetchStyle is Query::HYDRATE_COLUMN. Defaults to 0.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 185</div>
<h3 id="fetchColumn()">fetchColumn</h3>
<code class="signature">public string <strong>fetchColumn</strong>(integer columnIndex)</code>
<div class="details">
<p>fetchColumn
Returns a single column from the next row of a
result set or FALSE if there are no more rows.</p><dl>
<dt>Parameters:</dt>
<dd>columnIndex - 0-indexed number of the column you wish to retrieve from the row. If no value is supplied, PDOStatement->fetchColumn() fetches the first column.</dd>
<dt>Returns:</dt>
<dd>returns a single column in the next row of a result set.</dd>
</dl>
</div>
<hr>
<div class="location">/Doctrine/DBAL/Driver/Statement.php at line 199</div>
<h3 id="rowCount()">rowCount</h3>
<code class="signature">public integer <strong>rowCount</strong>()</code>
<div class="details">
<p>rowCount
rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement
executed by the corresponding object.</p><p>If the last SQL statement executed by the associated Statement object was a SELECT statement,
some databases may return the number of rows returned by that statement. However,
this behaviour is not guaranteed for all databases and should not be
relied on for portable applications.</p><dl>
<dt>Returns:</dt>
<dd>Returns the number of rows.</dd>
</dl>
</div>
<hr>
<div class="header">
<h1>Doctrine</h1>
<ul>
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="../../../doctrine/dbal/driver/package-summary.html">Namespace</a></li>
<li class="active">Class</li>
<li><a href="../../../doctrine/dbal/driver/package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
</ul>
</div>
<div class="small_links">
<a href="../../../index.html" target="_top">Frames</a>
<a href="../../../doctrine/dbal/driver/statement.html" target="_top">No frames</a>
</div>
<div class="small_links">
Summary: <a href="#summary_field">Field</a> | <a href="#summary_method">Method</a> | <a href="#summary_constr">Constr</a>
Detail: <a href="#detail_field">Field</a> | <a href="#detail_method">Method</a> | <a href="#summary_constr">Constr</a>
</div>
<hr>
<p id="footer">This document was generated by <a href="http://peej.github.com/phpdoctor/">PHPDoctor: The PHP Documentation Creator</a></p>
</body>
</html>