interface IStatementsAbstract (View source)

This interface defines the abstract methods for database statement operations.

Implementing classes should provide concrete implementations for these methods to handle database interactions.

Methods

void
setAllMetadata()

Reset query metadata

object
getAllMetadata()

Returns an object containing the number of queried rows and the number of affected rows.

string
getQueryString()

Returns the query string.

void
setQueryString(string $params)

Sets the query string for the Connection instance.

array|null
getQueryParameters()

Returns the parameters associated with this instance.

void
setQueryParameters(array|null $params)

Sets the query parameters for the Connection instance.

int|false
getQueryRows()

Returns the number of rows affected by an operation.

void
setQueryRows(callable|int|false $params)

Sets the number of query rows for the Connection instance.

int|false
getQueryColumns()

Returns the number of columns in a statement result.

void
setQueryColumns(int|false $params)

Sets the number of columns in the query result.

int|false
getAffectedRows()

Returns the number of rows affected by an operation.

void
setAffectedRows(int|false $params)

Sets the number of affected rows for the Connection instance.

mixed
getStatement()

Returns the statement for the function.

void
setStatement(mixed $statement)

Set the statement for the function.

mixed
quote(mixed ...$params)

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

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.

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

void setAllMetadata()

Reset query metadata

Return Value

void

object getAllMetadata()

Returns an object containing the number of queried rows and the number of affected rows.

Return Value

object

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

string getQueryString()

Returns the query string.

Return Value

string

The query string associated with this instance.

void setQueryString(string $params)

Sets the query string for the Connection instance.

Parameters

string $params

The query string to set.

Return Value

void

array|null getQueryParameters()

Returns the parameters associated with this instance.

Return Value

array|null

The parameters associated with this instance.

void setQueryParameters(array|null $params)

Sets the query parameters for the Connection instance.

Parameters

array|null $params

The query parameters to set.

Return Value

void

int|false getQueryRows()

Returns the number of rows affected by an operation.

Return Value

int|false

The number of affected rows

void setQueryRows(callable|int|false $params)

Sets the number of query rows for the Connection instance.

Parameters

callable|int|false $params

The number of query rows to set.

Return Value

void

int|false getQueryColumns()

Returns the number of columns in a statement result.

Return Value

int|false

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

void setQueryColumns(int|false $params)

Sets the number of columns in the query result.

Parameters

int|false $params

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

Return Value

void

int|false getAffectedRows()

Returns the number of rows affected by an operation.

Return Value

int|false

The number of affected rows

void setAffectedRows(int|false $params)

Sets the number of affected rows for the Connection instance.

Parameters

int|false $params

The number of affected rows to set.

Return Value

void

mixed getStatement()

Returns the statement for the function.

Return Value

mixed

void setStatement(mixed $statement)

Set the statement for the function.

Parameters

mixed $statement

The statement to be set.

Return Value

void

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

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

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