Class Zend_Test_DbStatement

Description

Implements interfaces:

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

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Test/DbStatement.php (line 37)


	
			
Variable Summary
Method Summary
 static Zend_Test_DbStatement createDeleteStatement ([int $affectedRows = 0])
 static Zend_Test_DbStatement createInsertStatement ([int $affectedRows = 0])
 static Zend_Test_DbStatement createSelectStatement ([ $rows = array()])
 static Zend_Test_DbStatement createUpdateStatement ([int $affectedRows = 0])
 static Zend_Test_DbStatement _createRowCountStatement (int $affectedRows)
 void append (array $row)
 bool bindColumn (string $column,  &$param, [mixed $type = null], mixed $param)
 bool bindParam (mixed $parameter,  &$variable, [mixed $type = null], [mixed $length = null], [mixed $options = null], mixed $variable)
 bool bindValue (mixed $parameter, mixed $value, [mixed $type = null])
 bool closeCursor ()
 int columnCount ()
 string errorCode ()
 array errorInfo ()
 bool execute ([ $params = array()])
 mixed fetch ([int $style = null], [int $cursor = null], [int $offset = null])
 array fetchAll ([int $style = null], [int $col = null])
 string fetchColumn ([int $col = 0])
 mixed fetchObject ([string $class = 'stdClass'], [ $config = array()])
 mixed getAttribute (string $key)
 bool nextRowset ()
 int rowCount ()
 bool setAttribute (string $key, mixed $val)
 bool setFetchMode (int $mode)
 void setQueryProfile ( $qp)
 void setRowCount (int $rowCount)
Variables
int $_columnCount = 0 (line 47)
  • access: protected
array $_fetchStack = array() (line 42)
  • access: protected
Zend_Db_Profiler_Query $_queryProfile = null (line 57)
  • access: protected
int $_rowCount = 0 (line 52)
  • access: protected
Methods
static createDeleteStatement (line 91)

Create an Delete Statement

  • access: public
static Zend_Test_DbStatement createDeleteStatement ([int $affectedRows = 0])
  • int $affectedRows
static createInsertStatement (line 80)

Create an Insert Statement

  • access: public
static Zend_Test_DbStatement createInsertStatement ([int $affectedRows = 0])
  • int $affectedRows
static createSelectStatement (line 65)

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

  • access: public
static Zend_Test_DbStatement createSelectStatement ([ $rows = array()])
  • array $rows
static createUpdateStatement (line 102)

Create an Update Statement

  • access: public
static Zend_Test_DbStatement createUpdateStatement ([int $affectedRows = 0])
  • int $affectedRows
static _createRowCountStatement (line 113)

Create a Row Count Statement

  • access: protected
static Zend_Test_DbStatement _createRowCountStatement (int $affectedRows)
  • int $affectedRows
append (line 141)

Append a new row to the fetch stack.

  • access: public
void append (array $row)
  • array $row
bindColumn (line 157)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
bool bindColumn (string $column,  &$param, [mixed $type = null], mixed $param)
  • string $column: Name the column in the result set, either by position or by name.
  • mixed $param: Reference to the PHP variable containing the value.
  • mixed $type: OPTIONAL
  • &$param
bindParam (line 173)

Binds a parameter to the specified variable name.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool bindParam (mixed $parameter,  &$variable, [mixed $type = null], [mixed $length = null], [mixed $options = null], mixed $variable)
  • mixed $parameter: Name the parameter, either integer or string.
  • mixed $variable: Reference to PHP variable containing the value.
  • mixed $type: OPTIONAL Datatype of SQL parameter.
  • mixed $length: OPTIONAL Length of SQL parameter.
  • mixed $options: OPTIONAL Other options.
  • &$variable
bindValue (line 190)

Binds a value to a parameter.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool bindValue (mixed $parameter, mixed $value, [mixed $type = null])
  • mixed $parameter: Name the parameter, either integer or string.
  • mixed $value: Scalar value to bind to the parameter.
  • mixed $type: OPTIONAL Datatype of the parameter.
closeCursor (line 201)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
bool closeCursor ()
columnCount (line 213)

Returns the number of columns in the result set.

Returns null if the statement has no result set metadata.

  • return: The number of columns.
  • throws: Zend_Db_Statement_Exception
  • access: public
int columnCount ()
errorCode (line 225)

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

  • return: error code.
  • throws: Zend_Db_Statement_Exception
  • access: public
string errorCode ()
errorInfo (line 237)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
array errorInfo ()
execute (line 249)

Executes a prepared statement.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool execute ([ $params = array()])
  • array $params: OPTIONAL Values to bind to parameter placeholders.
fetch (line 267)

Fetches a row from the result set.

  • return: Array, object, or scalar depending on fetch mode.
  • throws: Zend_Db_Statement_Exception
  • access: public
mixed fetch ([int $style = null], [int $cursor = null], [int $offset = null])
  • int $style: OPTIONAL Fetch mode for this fetch operation.
  • int $cursor: OPTIONAL Absolute, relative, or other.
  • int $offset: OPTIONAL Number for absolute or relative cursors.
fetchAll (line 285)

Returns an array containing all of the result set rows.

  • return: Collection of rows, each in a format by the fetch mode.
  • throws: Zend_Db_Statement_Exception
  • access: public
array fetchAll ([int $style = null], [int $col = null])
  • int $style: OPTIONAL Fetch mode.
  • int $col: OPTIONAL Column number, if fetch mode is by column.
fetchColumn (line 300)

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

  • throws: Zend_Db_Statement_Exception
  • access: public
string fetchColumn ([int $col = 0])
  • int $col: OPTIONAL Position of the column to fetch.
fetchObject (line 327)

Fetches the next row and returns it as an object.

  • return: One object instance of the specified class.
  • throws: Zend_Db_Statement_Exception
  • access: public
mixed fetchObject ([string $class = 'stdClass'], [ $config = array()])
  • string $class: OPTIONAL Name of the class to create.
  • array $config: OPTIONAL Constructor arguments for the class.
getAttribute (line 349)

Retrieve a statement attribute.

  • return: Attribute value.
  • throws: Zend_Db_Statement_Exception
  • access: public
mixed getAttribute (string $key)
  • string $key: Attribute name.
nextRowset (line 362)

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.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool nextRowset ()
rowCount (line 375)

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

  • return: The number of rows affected.
  • throws: Zend_Db_Statement_Exception
  • access: public
int rowCount ()
setAttribute (line 388)

Set a statement attribute.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool setAttribute (string $key, mixed $val)
  • string $key: Attribute name.
  • mixed $val: Attribute value.
setFetchMode (line 400)

Set the default fetch mode for this statement.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool setFetchMode (int $mode)
  • int $mode: The fetch mode.
setQueryProfile (line 123)
  • access: public
void setQueryProfile ( $qp)
setRowCount (line 131)
  • access: public
void setRowCount (int $rowCount)
  • int $rowCount

Documentation generated on Mon, 21 Jun 2010 15:16:12 -0400 by phpDocumentor 1.4.3