PHP Class Doctrine\DBAL\Driver\OCI8\OCI8Statement

Since: 2.0
Author: Roman Borschel ([email protected])
Inheritance: implements Doctrine\DBAL\Driver\Statement
Show file Open project: doctrine/dbal Class Usage Examples

Protected Properties

Property Type Description
$_PARAM string
$_conn Doctrine\DBAL\Driver\OCI8\OCI8Connection
$_dbh resource
$_defaultFetchMode integer
$_paramMap array
$_sth resource
$fetchModeMap array

Public Methods

Method Description
__construct ( resource $dbh, string $statement, Doctrine\DBAL\Driver\OCI8\OCI8Connection $conn ) Creates a new OCI8Statement that uses the given connection handle and SQL statement.
bindParam ( $column, &$variable, $type = null, $length = null )
bindValue ( $param, $value, $type = null )
closeCursor ( )
columnCount ( )
convertPositionalToNamedPlaceholders ( string $statement ) : string Converts positional (?) into named placeholders (:param).
errorCode ( )
errorInfo ( )
execute ( $params = null )
fetch ( $fetchMode = null )
fetchAll ( $fetchMode = null )
fetchColumn ( $columnIndex )
getIterator ( )
rowCount ( )
setFetchMode ( $fetchMode, $arg2 = null, $arg3 = null )

Method Details

__construct() public method

Creates a new OCI8Statement that uses the given connection handle and SQL statement.
public __construct ( resource $dbh, string $statement, Doctrine\DBAL\Driver\OCI8\OCI8Connection $conn )
$dbh resource The connection handle.
$statement string The SQL statement.
$conn Doctrine\DBAL\Driver\OCI8\OCI8Connection

bindParam() public method

public bindParam ( $column, &$variable, $type = null, $length = null )

bindValue() public method

public bindValue ( $param, $value, $type = null )

closeCursor() public method

public closeCursor ( )

columnCount() public method

public columnCount ( )

convertPositionalToNamedPlaceholders() public static method

Oracle does not support positional parameters, hence this method converts all positional parameters into artificially named parameters. Note that this conversion is not perfect. All question marks (?) in the original statement are treated as placeholders and converted to a named parameter. The algorithm uses a state machine with two possible states: InLiteral and NotInLiteral. Question marks inside literal strings are therefore handled correctly by this method. This comes at a cost, the whole sql statement has to be looped over.
public static convertPositionalToNamedPlaceholders ( string $statement ) : string
$statement string The SQL statement to convert.
return string

errorCode() public method

public errorCode ( )

errorInfo() public method

public errorInfo ( )

execute() public method

public execute ( $params = null )

fetch() public method

public fetch ( $fetchMode = null )

fetchAll() public method

public fetchAll ( $fetchMode = null )

fetchColumn() public method

public fetchColumn ( $columnIndex )

getIterator() public method

public getIterator ( )

rowCount() public method

public rowCount ( )

setFetchMode() public method

public setFetchMode ( $fetchMode, $arg2 = null, $arg3 = null )

Property Details

$_PARAM protected static property

protected static string $_PARAM
return string

$_conn protected property

protected OCI8Connection,Doctrine\DBAL\Driver\OCI8 $_conn
return Doctrine\DBAL\Driver\OCI8\OCI8Connection

$_dbh protected property

protected resource $_dbh
return resource

$_defaultFetchMode protected property

protected int $_defaultFetchMode
return integer

$_paramMap protected property

protected array $_paramMap
return array

$_sth protected property

protected resource $_sth
return resource

$fetchModeMap protected static property

protected static array $fetchModeMap
return array