Abstract Class Zend_Db_Statement

Description

Implements interfaces:

Abstract class to emulate a PDOStatement for native database adapters.

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

Located in /Db/Statement.php (line 41)


	
			
Direct descendents
Class Description
 class Zend_Db_Statement_Db2 Extends for DB2 native adapter.
 class Zend_Db_Statement_Mysqli Extends for Mysqli
 class Zend_Db_Statement_Oracle Extends for Oracle.
Variable Summary
Method Summary
 Zend_Db_Statement __construct (Zend_Db_Adapter_Abstract $adapter, mixed $sql)
 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])
 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 setAttribute (string $key, mixed $val)
 bool setFetchMode (int $mode)
 string _joinSql ()
 integer _normalizeBindParam (mixed $parameter,  &$variable, [ $supportsNumeric = true], [ $supportsNamed = true], mixed $variable)
 void _prepSql (string $sql)
Variables
Zend_Db_Adapter_Abstract $_adapter = null (line 47)
  • access: protected
array $_attribute = array() (line 61)

Attributes.

  • access: protected
array $_bindColumn = array() (line 68)

Column result bindings.

  • access: protected
array $_bindParam = array() (line 75)

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

  • access: protected
integer $_fetchMode = Zend_Db::FETCH_ASSOC (line 54)

The current fetch mode.

  • access: protected
array $_sqlParam = array() (line 89)

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

  • access: protected
array $_sqlSplit = array() (line 82)

SQL string split into an array at placeholders.

  • access: protected
Methods
Constructor __construct (line 97)

Constructor for a statement.

  • access: public
Zend_Db_Statement __construct (Zend_Db_Adapter_Abstract $adapter, mixed $sql)
bindColumn (line 162)

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

Implementation of:
Zend_Db_Statement_Interface::bindColumn()
Bind a column of the statement result set to a PHP variable.
bindParam (line 229)

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

Implementation of:
Zend_Db_Statement_Interface::bindParam()
Binds a parameter to the specified variable name.

Redefined in descendants as:
bindValue (line 244)

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.

Implementation of:
Zend_Db_Statement_Interface::bindValue()
Binds a value to a parameter.
fetchAll (line 257)

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.

Implementation of:
Zend_Db_Statement_Interface::fetchAll()
Returns an array containing all of the result set rows.

Redefined in descendants as:
fetchColumn (line 282)

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.

Implementation of:
Zend_Db_Statement_Interface::fetchColumn()
Returns a single column from the next row of a result set.

Redefined in descendants as:
fetchObject (line 302)

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.

Implementation of:
Zend_Db_Statement_Interface::fetchObject()
Fetches the next row and returns it as an object.

Redefined in descendants as:
getAttribute (line 319)

Retrieve a statement attribute.

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

Implementation of:
Zend_Db_Statement_Interface::getAttribute()
Retrieve a statement attribute.
setAttribute (line 334)

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.

Implementation of:
Zend_Db_Statement_Interface::setAttribute()
Set a statement attribute.
setFetchMode (line 346)

Set the default fetch mode for this statement.

  • throws: Zend_Db_Statement_Exception
  • access: public
bool setFetchMode (int $mode)
  • int $mode: The fetch mode.

Implementation of:
Zend_Db_Statement_Interface::setFetchMode()
Set the default fetch mode for this statement.
_joinSql (line 142)

Joins SQL text and bound params into a string.

This emulates SQL parameters by quoting the values directly into the SQL string.

  • access: protected
string _joinSql ()
_normalizeBindParam (line 177)

Check sanity of bind parameters. Throw exceptions if params are not valid.

  • throws: Zend_Db_Statement_Exception
  • access: protected
integer _normalizeBindParam (mixed $parameter,  &$variable, [ $supportsNumeric = true], [ $supportsNamed = true], mixed $variable)
  • mixed $parameter: Name the parameter, either integer or string.
  • mixed $variable: Reference to PHP variable containing the value.
  • &$variable
  • $supportsNumeric
  • $supportsNamed
_prepSql (line 117)

Splits SQL into text and params, sets up $this->_bindParam for replacements.

  • access: protected
void _prepSql (string $sql)
  • string $sql

Redefined in descendants as:

Documentation generated on Sun, 27 May 2007 23:27:50 -0700 by phpDocumentor 1.3.2