API Documentation

Db/Statement.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Statement
version
$Id: Statement.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Db_Statement

Description

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.

Zend_Db_Statement

Implements
Zend_Db_Statement_Interface
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Db
subpackage
Statement
Properties
$_stmt
$_adapter
$_fetchMode
$_attribute
$_bindColumn
$_bindParam
$_sqlSplit
$_sqlParam
$_queryId
Methods
__construct
_prepare
_parseParameters
_stripQuoted
bindColumn
bindParam
bindValue
execute
fetchAll
fetchColumn
fetchObject
getAttribute
setAttribute
setFetchMode
_fetchBound
getAdapter
getDriverStatement

Description

Abstract class to emulate a PDOStatement for native database adapters.

Properties

$_adapter

Zend_Db_Adapter_Abstract $_adapter = 'null'

Details

$_adapter
Zend_Db_Adapter_Abstract
visibility
protected
default
null
final
false
static
false

$_attribute

array $_attribute = 'array'

Attributes.

Details

$_attribute
array
visibility
protected
default
array
final
false
static
false

$_bindColumn

array $_bindColumn = 'array'

Column result bindings.

Details

$_bindColumn
array
visibility
protected
default
array
final
false
static
false

$_bindParam

array $_bindParam = 'array'

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

Details

$_bindParam
array
visibility
protected
default
array
final
false
static
false

$_fetchMode

integer $_fetchMode = 'Zend_Db'

The current fetch mode.

Details

$_fetchMode
integer
visibility
protected
default
Zend_Db
final
false
static
false

$_queryId

Zend_Db_Profiler_Query $_queryId = 'null'

Details

$_queryId
Zend_Db_Profiler_Query
visibility
protected
default
null
final
false
static
false

$_sqlParam

array $_sqlParam = 'array'

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

Details

$_sqlParam
array
visibility
protected
default
array
final
false
static
false

$_sqlSplit

array $_sqlSplit = 'array'

SQL string split into an array at placeholders.

Details

$_sqlSplit
array
visibility
protected
default
array
final
false
static
false

$_stmt

resource|object $_stmt = 'null'

Details

$_stmt
resource|object
The driver level statement object/resource
visibility
protected
default
null
final
false
static
false

Methods

__construct

__construct( Zend_Db_Adapter_Abstract $adapter, mixed $sql ) :

Constructor for a statement.

Arguments
$adapter
Zend_Db_Adapter_Abstract
$sql
mixed
Either a string or Zend_Db_Select.
Details
visibility
public
final
false
static
false

_fetchBound

_fetchBound( array $row ) : bool

Helper function to map retrieved row to bound column variables

Arguments
$row
array
Output
bool
True
Details
visibility
public
final
false
static
false

_parseParameters

_parseParameters( string $sql ) : void

Arguments
$sql
string
Details
visibility
protected
final
false
static
false

_prepare

_prepare(  $sql ) : void

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

Arguments
$sql
Details
visibility
protected
final
false
static
false

_stripQuoted

_stripQuoted( string $sql ) : string

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

Arguments
$sql
string
Output
string
Details
visibility
protected
final
false
static
false

bindColumn

bindColumn( string $column, mixed $param, mixed $type = null ) : bool

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

Arguments
$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
Output
bool
Details
visibility
public
final
false
static
false

bindParam

bindParam( mixed $parameter, mixed $variable, mixed $type = null, mixed $length = null, mixed $options = null ) : bool

Binds a parameter to the specified variable name.

Arguments
$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.
Output
bool
Details
visibility
public
final
false
static
false

bindValue

bindValue( mixed $parameter, mixed $value, mixed $type = null ) : bool

Binds a value to a parameter.

Arguments
$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.
Output
bool
Details
visibility
public
final
false
static
false

execute

execute( array $params = null ) : bool

Executes a prepared statement.

Arguments
$params
array
OPTIONAL Values to bind to parameter placeholders.
Output
bool
Details
visibility
public
final
false
static
false

fetchAll

fetchAll( int $style = null, int $col = null ) : array

Returns an array containing all of the result set rows.

Arguments
$style
int
OPTIONAL Fetch mode.
$col
int
OPTIONAL Column number, if fetch mode is by column.
Output
array
Collection of rows, each in a format by the fetch mode.
Details
visibility
public
final
false
static
false

fetchColumn

fetchColumn( int $col = 0 ) : string

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

Arguments
$col
int
OPTIONAL Position of the column to fetch.
Output
string
One value from the next row of result set, or false.
Details
visibility
public
final
false
static
false

fetchObject

fetchObject( string $class = stdClass, array $config = array ) : mixed

Fetches the next row and returns it as an object.

Arguments
$class
string
OPTIONAL Name of the class to create.
$config
array
OPTIONAL Constructor arguments for the class.
Output
mixed
One object instance of the specified class, or false.
Details
visibility
public
final
false
static
false

getAdapter

getAdapter( ) : Zend_Db_Adapter_Abstract

Gets the Zend_Db_Adapter_Abstract for this particular Zend_Db_Statement object.

Details
visibility
public
final
false
static
false

getAttribute

getAttribute( string $key ) : mixed

Retrieve a statement attribute.

Arguments
$key
string
Attribute name.
Output
mixed
Attribute value.
Details
visibility
public
final
false
static
false

getDriverStatement

getDriverStatement( ) : unknown_type

Gets the resource or object setup by the _parse

Output
unknown_type
Details
visibility
public
final
false
static
false

setAttribute

setAttribute( string $key, mixed $val ) : bool

Set a statement attribute.

Arguments
$key
string
Attribute name.
$val
mixed
Attribute value.
Output
bool
Details
visibility
public
final
false
static
false

setFetchMode

setFetchMode( int $mode ) : bool

Set the default fetch mode for this statement.

Arguments
$mode
int
The fetch mode.
Output
bool
Details
visibility
public
final
false
static
false
throws
Documentation was generated by DocBlox.