API Documentation

Test/DbStatement.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_Test
subpackage
PHPUnit
version
$Id: DbStatement.php 20096 2010-01-06 02:05:09Z bkarwin $
Classes
Zend_Test_DbStatement

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_Test_DbStatement

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_Test
subpackage
PHPUnit
Properties
$_fetchStack
$_columnCount
$_rowCount
$_queryProfile
Methods
createSelectStatement
createInsertStatement
createDeleteStatement
createUpdateStatement
_createRowCountStatement
setQueryProfile
setRowCount
append
bindColumn
bindParam
bindValue
closeCursor
columnCount
errorCode
errorInfo
execute
fetch
fetchAll
fetchColumn
fetchObject
getAttribute
nextRowset
rowCount
setAttribute
setFetchMode

Description

Testing Database Statement that acts as a stack to SQL resultsets.

Properties

$_columnCount

int $_columnCount = '0'

Details

$_columnCount
int
visibility
protected
default
0
final
false
static
false

$_fetchStack

array $_fetchStack = 'array'

Details

$_fetchStack
array
visibility
protected
default
array
final
false
static
false

$_queryProfile

Zend_Db_Profiler_Query $_queryProfile = 'null'

Details

$_queryProfile
Zend_Db_Profiler_Query
visibility
protected
default
null
final
false
static
false

$_rowCount

int $_rowCount = '0'

Details

$_rowCount
int
visibility
protected
default
0
final
false
static
false

Methods

_createRowCountStatement

_createRowCountStatement( int $affectedRows ) : Zend_Test_DbStatement

Create a Row Count Statement

Arguments
$affectedRows
int
Details
visibility
protected
final
false
static
true

append

append( array $row ) :

Append a new row to the fetch stack.

Arguments
$row
array
Details
visibility
public
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
throws

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
throws

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
throws

closeCursor

closeCursor( ) : bool

Closes the cursor, allowing the statement to be executed again.

Output
bool
Details
visibility
public
final
false
static
false
throws

columnCount

columnCount( ) : int

Returns the number of columns in the result set.

Returns null if the statement has no result set metadata.

Output
int
The number of columns.
Details
visibility
public
final
false
static
false
throws

createDeleteStatement

createDeleteStatement( int $affectedRows = 0 ) : Zend_Test_DbStatement

Create an Delete Statement

Arguments
$affectedRows
int
Details
visibility
public
final
false
static
true

createInsertStatement

createInsertStatement( int $affectedRows = 0 ) : Zend_Test_DbStatement

Create an Insert Statement

Arguments
$affectedRows
int
Details
visibility
public
final
false
static
true

createSelectStatement

createSelectStatement( array $rows = array ) : Zend_Test_DbStatement

Create a Select statement which returns the given array of rows.

Arguments
$rows
array
Details
visibility
public
final
false
static
true

createUpdateStatement

createUpdateStatement( int $affectedRows = 0 ) : Zend_Test_DbStatement

Create an Update Statement

Arguments
$affectedRows
int
Details
visibility
public
final
false
static
true

errorCode

errorCode( ) : string

Retrieves the error code, if any, associated with the last operation on the statement handle.

Output
string
error code.
Details
visibility
public
final
false
static
false
throws

errorInfo

errorInfo( ) : array

Retrieves an array of error information, if any, associated with the last operation on the statement handle.

Output
array
Details
visibility
public
final
false
static
false
throws

execute

execute( array $params = array ) : bool

Executes a prepared statement.

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

fetch

fetch( int $style = null, int $cursor = null, int $offset = null ) : mixed

Fetches a row from the result set.

Arguments
$style
int
OPTIONAL Fetch mode for this fetch operation.
$cursor
int
OPTIONAL Absolute, relative, or other.
$offset
int
OPTIONAL Number for absolute or relative cursors.
Output
mixed
Array, object, or scalar depending on fetch mode.
Details
visibility
public
final
false
static
false
throws

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
throws

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
Details
visibility
public
final
false
static
false
throws

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.
Details
visibility
public
final
false
static
false
throws

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
throws

nextRowset

nextRowset( ) : bool

Retrieves the next rowset (result set) for a SQL statement that has multiple result sets. An example is a stored procedure that returns the results of multiple queries.

Output
bool
Details
visibility
public
final
false
static
false
throws

rowCount

rowCount( ) : int

Returns the number of rows affected by the execution of the last INSERT, DELETE, or UPDATE statement executed by this statement object.

Output
int
The number of rows affected.
Details
visibility
public
final
false
static
false
throws

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
throws

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

setQueryProfile

setQueryProfile( Zend_Db_Profiler_Query $qp ) :

Arguments
$qp
Zend_Db_Profiler_Query
Details
visibility
public
final
false
static
false

setRowCount

setRowCount( int $rowCount ) :

Arguments
$rowCount
int
Details
visibility
public
final
false
static
false
Documentation was generated by DocBlox.