class StatementsHandler extends AbstractStatements implements IStatements (View source)

Concrete implementation for OCI database

Properties

static protected IConnection $instance from  AbstractStatements
static protected IOptions $optionsHandler from  AbstractStatements
static protected IReport $reportHandler from  AbstractStatements
protected Metadata $metadata from  AbstractStatements
protected mixed|null $statement from  AbstractStatements

Methods

__construct(IConnection $instance, IOptions $optionsHandler, IReport $reportHandler)

Initialize statements with required handlers

static IConnection
getInstance()

Get the database connection instance

void
set(string $name, mixed $value)

Set a value using dynamic method call

mixed
get(string $name)

Get a value using dynamic method call

getOptionsHandler()

Get the options handler instance

getReportHandler()

Get the report handler instance

void
setAllMetadata()

Reset all metadata to default values

object
getAllMetadata()

Get all metadata

string
getQueryString()

Get the current query string

void
setQueryString(string $params)

Set the query string

array|null
getQueryParameters()

Get the current query parameters

void
setQueryParameters(array|null $params)

Set the query parameters

int|false
getQueryRows()

Get number of rows fetched

void
setQueryRows(callable|int|false $params)

Set number of rows fetched

int|false
getQueryColumns()

Get number of columns in result

void
setQueryColumns(int|false $params)

Set number of columns in result

int|false
getAffectedRows()

Get number of affected rows

void
setAffectedRows(int|false $params)

Set number of affected rows

mixed
getStatement()

Get current statement object

void
setStatement(mixed $statement)

Set statement object

string|int|false
lastInsertId(string|null $name = null)

This function returns the last ID generated by an auto-increment column, either the last one inserted during the current transaction, or by passing in the optional name parameter.

mixed
quote(mixed ...$params)

This function quotes a string for use in an SQL statement and escapes special characters (such as quotes).

void
bindParam(object $params)

Binds a parameter to a variable in the SQL statement.

string
parse(mixed ...$params)

Parses an SQL statement and returns an statement.

mixed
query(mixed ...$params)

This function executes an SQL statement and returns the result set as a statement object.

mixed
prepare(mixed ...$params)

This function binds the parameters to a prepared query.

mixed
exec(mixed ...$params)

This function runs an SQL statement and returns the number of affected rows.

Details

__construct(IConnection $instance, IOptions $optionsHandler, IReport $reportHandler)

Initialize statements with required handlers

Parameters

IConnection $instance

Database connection instance

IOptions $optionsHandler

Options handler instance

IReport $reportHandler

Report handler instance

static IConnection getInstance()

Get the database connection instance

Return Value

IConnection

Current connection instance

void set(string $name, mixed $value)

Set a value using dynamic method call

Parameters

string $name

Name of property to set

mixed $value

Value to set

Return Value

void

mixed get(string $name)

Get a value using dynamic method call

Parameters

string $name

Name of property to get

Return Value

mixed

Retrieved value

IOptions getOptionsHandler()

Get the options handler instance

Return Value

IOptions

Current options handler

IReport getReportHandler()

Get the report handler instance

Return Value

IReport

Current report handler

void setAllMetadata()

Reset all metadata to default values

Return Value

void

object getAllMetadata()

Get all metadata

Return Value

object

An associative object with keys 'queryRows' and 'affectedRows'.

string getQueryString()

Get the current query string

Return Value

string

The query string associated with this instance.

void setQueryString(string $params)

Set the query string

Parameters

string $params

The query string to set.

Return Value

void

array|null getQueryParameters()

Get the current query parameters

Return Value

array|null

The parameters associated with this instance.

void setQueryParameters(array|null $params)

Set the query parameters

Parameters

array|null $params

The query parameters to set.

Return Value

void

int|false getQueryRows()

Get number of rows fetched

Return Value

int|false

The number of affected rows

void setQueryRows(callable|int|false $params)

Set number of rows fetched

Parameters

callable|int|false $params

The number of query rows to set.

Return Value

void

int|false getQueryColumns()

Get number of columns in result

Return Value

int|false

The number of columns in the result or false in case of an error.

void setQueryColumns(int|false $params)

Set number of columns in result

Parameters

int|false $params

The number of columns or false if there are no columns.

Return Value

void

int|false getAffectedRows()

Get number of affected rows

Return Value

int|false

The number of affected rows

void setAffectedRows(int|false $params)

Set number of affected rows

Parameters

int|false $params

The number of affected rows to set.

Return Value

void

mixed getStatement()

Get current statement object

Return Value

mixed

void setStatement(mixed $statement)

Set statement object

Parameters

mixed $statement

The statement to be set.

Return Value

void

string|int|false lastInsertId(string|null $name = null)

This function returns the last ID generated by an auto-increment column, either the last one inserted during the current transaction, or by passing in the optional name parameter.

Parameters

string|null $name

= null Resource name, table or view

Return Value

string|int|false

mixed quote(mixed ...$params)

This function quotes a string for use in an SQL statement and escapes special characters (such as quotes).

Parameters

mixed ...$params

Content to be quoted

Return Value

mixed

void bindParam(object $params)

Binds a parameter to a variable in the SQL statement.

Parameters

object $params

The name of the parameter or an array of parameters and values.

Return Value

void

string parse(mixed ...$params)

Parses an SQL statement and returns an statement.

Parameters

mixed ...$params

The parameters for the query function.

Return Value

string

The statement resulting from the SQL statement.

mixed query(mixed ...$params)

This function executes an SQL statement and returns the result set as a statement object.

Parameters

mixed ...$params

Statement to be queried

Return Value

mixed

mixed prepare(mixed ...$params)

This function binds the parameters to a prepared query.

Parameters

mixed ...$params

Return Value

mixed

mixed exec(mixed ...$params)

This function runs an SQL statement and returns the number of affected rows.

Parameters

mixed ...$params

Statement to be executed

Return Value

mixed