Public Member Functions | Protected Member Functions | Protected Attributes

Zend_Db_Statement Class Reference

Inheritance diagram for Zend_Db_Statement:
Zend_Db_Statement_Interface Zend_Db_Statement_Db2 Zend_Db_Statement_Mysqli Zend_Db_Statement_Oracle Zend_Db_Statement_Pdo Zend_Db_Statement_Sqlsrv ZendX_Db_Statement_Firebird Zend_Db_Statement_Pdo_Ibm Zend_Db_Statement_Pdo_Oci

Public Member Functions

 __construct ($adapter, $sql)
 bindColumn ($column, &$param, $type=null)
 bindParam ($parameter, &$variable, $type=null, $length=null, $options=null)
 bindValue ($parameter, $value, $type=null)
 execute (array $params=null)
 fetchAll ($style=null, $col=null)
 fetchColumn ($col=0)
 fetchObject ($class= 'stdClass', array $config=array())
 getAttribute ($key)
 setAttribute ($key, $val)
 setFetchMode ($mode)
 _fetchBound ($row)
 getAdapter ()
 getDriverStatement ()

Protected Member Functions

 _prepare ($sql)
 _parseParameters ($sql)
 _stripQuoted ($sql)

Protected Attributes

 $_stmt = null
 $_adapter = null
 $_fetchMode = Zend_Db::FETCH_ASSOC
 $_attribute = array()
 $_bindColumn = array()
 $_bindParam = array()
 $_sqlSplit = array()
 $_sqlParam = array()
 $_queryId = null

Detailed Description

Definition at line 42 of file Statement.php.


Constructor & Destructor Documentation

__construct ( adapter,
sql 
)

Constructor for a statement.

Parameters:
Zend_Db_Adapter_Abstract$adapter
mixed$sqlEither a string or Zend_Db_Select.

Definition at line 108 of file Statement.php.


Member Function Documentation

_fetchBound ( row )

Helper function to map retrieved row to bound column variables

Parameters:
array$row
Returns:
bool True

Definition at line 449 of file Statement.php.

_parseParameters ( sql ) [protected]
Parameters:
string$sql
Returns:
void

See also:
Zend_Db_Statement_Exception
Zend_Db_Statement_Exception

Definition at line 135 of file Statement.php.

_prepare ( sql ) [protected]

Internal method called by abstract statment constructor to setup the driver level statement

Returns:
void

Reimplemented in Zend_Db_Statement_Db2, Zend_Db_Statement_Mysqli, Zend_Db_Statement_Oracle, Zend_Db_Statement_Pdo, Zend_Db_Statement_Sqlsrv, and ZendX_Db_Statement_Firebird.

Definition at line 126 of file Statement.php.

_stripQuoted ( sql ) [protected]

Remove parts of a SQL string that contain quoted strings of values or identifiers.

Parameters:
string$sql
Returns:
string

Definition at line 177 of file Statement.php.

bindColumn ( column,
&$  param,
type = null 
)

Bind a column of the statement result set to a PHP variable.

Parameters:
string$columnName the column in the result set, either by position or by name.
mixed$paramReference to the PHP variable containing the value.
mixed$typeOPTIONAL
Returns:
bool

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Pdo.

Definition at line 222 of file Statement.php.

bindParam ( parameter,
&$  variable,
type = null,
length = null,
options = null 
)

Binds a parameter to the specified variable name.

Parameters:
mixed$parameterName the parameter, either integer or string.
mixed$variableReference to PHP variable containing the value.
mixed$typeOPTIONAL Datatype of SQL parameter.
mixed$lengthOPTIONAL Length of SQL parameter.
mixed$optionsOPTIONAL Other options.
Returns:
bool

See also:
Zend_Db_Statement_Exception
Zend_Db_Statement_Exception

Implements Zend_Db_Statement_Interface.

Definition at line 238 of file Statement.php.

bindValue ( parameter,
value,
type = null 
)

Binds a value to a parameter.

Parameters:
mixed$parameterName the parameter, either integer or string.
mixed$valueScalar value to bind to the parameter.
mixed$typeOPTIONAL Datatype of the parameter.
Returns:
bool

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Pdo.

Definition at line 283 of file Statement.php.

execute ( array $  params = null )

Executes a prepared statement.

Parameters:
array$paramsOPTIONAL Values to bind to parameter placeholders.
Returns:
bool

Implements Zend_Db_Statement_Interface.

Definition at line 294 of file Statement.php.

fetchAll ( style = null,
col = null 
)

Returns an array containing all of the result set rows.

Parameters:
int$styleOPTIONAL Fetch mode.
int$colOPTIONAL Column number, if fetch mode is by column.
Returns:
array Collection of rows, each in a format by the fetch mode.

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Db2, Zend_Db_Statement_Oracle, Zend_Db_Statement_Pdo_Ibm, Zend_Db_Statement_Pdo_Oci, and Zend_Db_Statement_Pdo.

Definition at line 334 of file Statement.php.

fetchColumn ( col = 0 )

Returns a single column from the next row of a result set.

Parameters:
int$colOPTIONAL Position of the column to fetch.
Returns:
string One value from the next row of result set, or false.

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Oracle, Zend_Db_Statement_Pdo, and Zend_Db_Statement_Sqlsrv.

Definition at line 358 of file Statement.php.

fetchObject ( class = 'stdClass',
array $  config = array() 
)

Fetches the next row and returns it as an object.

Parameters:
string$classOPTIONAL Name of the class to create.
array$configOPTIONAL Constructor arguments for the class.
Returns:
mixed One object instance of the specified class, or false.

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Db2, Zend_Db_Statement_Oracle, Zend_Db_Statement_Pdo, and Zend_Db_Statement_Sqlsrv.

Definition at line 376 of file Statement.php.

getAdapter (  )

Gets the Zend_Db_Adapter_Abstract for this particular Zend_Db_Statement object.

Returns:
Zend_Db_Adapter_Abstract

Definition at line 471 of file Statement.php.

getAttribute ( key )

Retrieve a statement attribute.

Parameters:
string$keyAttribute name.
Returns:
mixed Attribute value.

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Pdo.

Definition at line 395 of file Statement.php.

getDriverStatement (  )

Gets the resource or object setup by the _parse

Returns:
unknown_type

Definition at line 481 of file Statement.php.

setAttribute ( key,
val 
)

Set a statement attribute.

Parameters:
string$keyAttribute name.
mixed$valAttribute value.
Returns:
bool

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Pdo.

Definition at line 409 of file Statement.php.

setFetchMode ( mode )

Set the default fetch mode for this statement.

Parameters:
int$modeThe fetch mode.
Returns:
bool
Exceptions:
Zend_Db_Statement_Exception

See also:
Zend_Db_Statement_Exception

Implements Zend_Db_Statement_Interface.

Reimplemented in Zend_Db_Statement_Pdo.

Definition at line 421 of file Statement.php.


The documentation for this class was generated from the following file: