API Documentation

Zend/Db/Statement.php

Show: inherited
Table of Contents

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Db  
Subpackage
Statement  
Version
$Id: Statement.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Db_Statement

Package: Zend\Db\Statement

Abstract class to emulate a PDOStatement for native database adapters.

Implements
\Zend_Db_Statement_Interface
Children
\Zend_Db_Statement_Oracle
\Zend_Db_Statement_Mysqli
\Zend_Db_Statement_Pdo
\Zend_Db_Statement_Sqlsrv
\Zend_Db_Statement_Db2
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

Propertyprotected\Zend_Db_Adapter_Abstract  $_adapter= 'null'

Default valuenullDetails
Type
\Zend_Db_Adapter_Abstract
Propertyprotectedarray  $_attribute= 'array()'

Attributes.

Default valuearray()Details
Type
array
Propertyprotectedarray  $_bindColumn= 'array()'

Column result bindings.

Default valuearray()Details
Type
array
Propertyprotectedarray  $_bindParam= 'array()'

Query parameter bindings; covers bindParam() and bindValue().

Default valuearray()Details
Type
array
Propertyprotectedinteger  $_fetchMode= 'Zend_Db::FETCH_ASSOC'

The current fetch mode.

Default valueZend_Db::FETCH_ASSOCDetails
Type
integer
Propertyprotected\Zend_Db_Profiler_Query  $_queryId= 'null'

Default valuenullDetails
Type
\Zend_Db_Profiler_Query
Propertyprotectedarray  $_sqlParam= 'array()'

Parameter placeholders in the SQL string by position in the split array.

Default valuearray()Details
Type
array
Propertyprotectedarray  $_sqlSplit= 'array()'

SQL string split into an array at placeholders.

Default valuearray()Details
Type
array
Propertyprotectedresource|object  $_stmt= 'null'

The driver level statement object/resource
Default valuenullDetails
Type
resourceobject

Methods

methodpublic__construct( \Zend_Db_Adapter_Abstract $adapter, mixed $sql ) : void

Constructor for a statement.

Parameters
Name Type Description
$adapter \Zend_Db_Adapter_Abstract
$sql mixed

Either a string or Zend_Db_Select.

methodpublic_fetchBound( array $row ) : bool

Helper function to map retrieved row to bound column variables

Parameters
Name Type Description
$row array
Returns
Type Description
bool True
methodprotected_parseParameters( string $sql ) : void

Parameters
Name Type Description
$sql string
methodprotected_prepare(  $sql ) : void

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

Parameters
Name Type Description
$sql
methodprotected_stripQuoted( string $sql ) : string

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

Parameters
Name Type Description
$sql string
Returns
Type Description
string
methodpublicbindColumn( string $column, mixed $param, mixed $type = null ) : bool

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

Parameters
Name Type Description
$column string

Name the column in the result set, either by position or by name.

$param mixed

Reference to the PHP variable containing the value.

$type mixed

OPTIONAL

Returns
Type Description
bool
methodpublicbindParam( mixed $parameter, mixed $variable, mixed $type = null, mixed $length = null, mixed $options = null ) : bool

Binds a parameter to the specified variable name.

Parameters
Name Type Description
$parameter mixed

Name the parameter, either integer or string.

$variable mixed

Reference to PHP variable containing the value.

$type mixed

OPTIONAL Datatype of SQL parameter.

$length mixed

OPTIONAL Length of SQL parameter.

$options mixed

OPTIONAL Other options.

Returns
Type Description
bool
methodpublicbindValue( mixed $parameter, mixed $value, mixed $type = null ) : bool

Binds a value to a parameter.

Parameters
Name Type Description
$parameter mixed

Name the parameter, either integer or string.

$value mixed

Scalar value to bind to the parameter.

$type mixed

OPTIONAL Datatype of the parameter.

Returns
Type Description
bool
methodpublicexecute( array $params = null ) : bool

Executes a prepared statement.

Parameters
Name Type Description
$params array

OPTIONAL Values to bind to parameter placeholders.

Returns
Type Description
bool
methodpublicfetchAll( int $style = null, int $col = null ) : array

Returns an array containing all of the result set rows.

Parameters
Name Type Description
$style int

OPTIONAL Fetch mode.

$col int

OPTIONAL Column number, if fetch mode is by column.

Returns
Type Description
array Collection of rows, each in a format by the fetch mode.
methodpublicfetchColumn( int $col = 0 ) : string

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

Parameters
Name Type Description
$col int

OPTIONAL Position of the column to fetch.

Returns
Type Description
string One value from the next row of result set, or false.
methodpublicfetchObject( string $class = 'stdClass', array $config = array() ) : mixed

Fetches the next row and returns it as an object.

Parameters
Name Type Description
$class string

OPTIONAL Name of the class to create.

$config array

OPTIONAL Constructor arguments for the class.

Returns
Type Description
mixed One object instance of the specified class, or false.
methodpublicgetAdapter( ) : \Zend_Db_Adapter_Abstract

Gets the Zend_Db_Adapter_Abstract for this particular Zend_Db_Statement object.

Returns
Type Description
\Zend_Db_Adapter_Abstract
methodpublicgetAttribute( string $key ) : mixed

Retrieve a statement attribute.

Parameters
Name Type Description
$key string

Attribute name.

Returns
Type Description
mixed Attribute value.
methodpublicgetDriverStatement( ) : \unknown_type

Gets the resource or object setup by the _parse

Returns
Type Description
\unknown_type
methodpublicsetAttribute( string $key, mixed $val ) : bool

Set a statement attribute.

Parameters
Name Type Description
$key string

Attribute name.

$val mixed

Attribute value.

Returns
Type Description
bool
methodpublicsetFetchMode( int $mode ) : bool

Set the default fetch mode for this statement.

Parameters
Name Type Description
$mode int

The fetch mode.

Returns
Type Description
bool
Throws
Exception Description
\Zend_Db_Statement_Exception
Documentation was generated by DocBlox 0.15.1.