[ Index ]

PHP Cross Reference of YOURLS

title

Body

[close]

/includes/vendor/aura/sql/src/ -> AbstractExtendedPdo.php (summary)

This file is part of Aura for PHP.

License: https://opensource.org/licenses/MIT MIT
File Size: 1012 lines (27 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 42 functions

  __call()
  beginTransaction()
  commit()
  errorCode()
  errorInfo()
  exec()
  fetchAffected()
  fetchAll()
  fetchAssoc()
  fetchCol()
  fetchGroup()
  fetchObject()
  fetchObjects()
  fetchOne()
  fetchPairs()
  fetchValue()
  getParser()
  getPdo()
  getProfiler()
  inTransaction()
  isConnected()
  lastInsertId()
  perform()
  prepare()
  prepareWithValues()
  query()
  quote()
  quoteName()
  quoteSingleName()
  rollBack()
  setParser()
  setProfiler()
  yieldAll()
  yieldAssoc()
  yieldCol()
  yieldObjects()
  yieldPairs()
  bindValue()
  newParser()
  setQuoteName()
  getAttribute()
  setAttribute()

Functions
Functions that are not part of a class:

__call(string $name, array $arguments)   X-Ref
Proxies to PDO methods created for specific drivers; in particular,
`sqlite` and `pgsql`.

param: string $name The PDO method to call; e.g. `sqliteCreateFunction`
param: array $arguments Arguments to pass to the called method.
return: mixed

beginTransaction()   X-Ref
Begins a transaction and turns off autocommit mode.

return: bool True on success, false on failure.

commit()   X-Ref
Commits the existing transaction and restores autocommit mode.

return: bool True on success, false on failure.

errorCode()   X-Ref
Gets the most recent error code.

return: string|null

errorInfo()   X-Ref
Gets the most recent error info.

return: array

exec(string $statement)   X-Ref
Executes an SQL statement and returns the number of affected rows.

param: string $statement The SQL statement to prepare and execute.
return: int|false The number of affected rows.

fetchAffected(string $statement, array $values = [])   X-Ref
Performs a statement and returns the number of affected rows.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: int

fetchAll(string $statement, array $values = [])   X-Ref
Fetches a sequential array of rows from the database; the rows
are returned as associative arrays.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: array

fetchAssoc(string $statement, array $values = [])   X-Ref
Fetches an associative array of rows from the database; the rows
are returned as associative arrays, and the array of rows is keyed
on the first column of each row.

N.b.: If multiple rows have the same first column value, the last
row with that value will override earlier rows.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: array

fetchCol(string $statement, array $values = [])   X-Ref
Fetches the first column of rows as a sequential array.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: array

fetchGroup(string $statement,array $values = [],int $style = PDO::FETCH_COLUMN)   X-Ref
Fetches multiple from the database as an associative array. The first
column will be the index key.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
param: int $style a fetch style defaults to PDO::FETCH_COLUMN for single
return: array

fetchObject(string $statement,array $values = [],string $class = 'stdClass',array $args = [])   X-Ref
Fetches one row from the database as an object where the column values
are mapped to object properties.

Warning: PDO "injects property-values BEFORE invoking the constructor -
in other words, if your class initializes property-values to defaults
in the constructor, you will be overwriting the values injected by
fetchObject() !"

<http://www.php.net/manual/en/pdostatement.fetchobject.php#111744>

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
param: string $class The name of the class to create.
param: array $args Arguments to pass to the object constructor.
return: object

fetchObjects(string $statement,array $values = [],string $class = 'stdClass',array $args = [])   X-Ref
Fetches a sequential array of rows from the database; the rows
are returned as objects where the column values are mapped to
object properties.

Warning: PDO "injects property-values BEFORE invoking the constructor -
in other words, if your class initializes property-values to defaults
in the constructor, you will be overwriting the values injected by
fetchObject() !"

<http://www.php.net/manual/en/pdostatement.fetchobject.php#111744>

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
param: string $class The name of the class to create from each
param: array $args Arguments to pass to each object constructor.
return: array

fetchOne(string $statement, array $values = [])   X-Ref
Fetches one row from the database as an associative array.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: array|false

fetchPairs(string $statement, array $values = [])   X-Ref
Fetches an associative array of rows as key-value pairs (first
column is the key, second column is the value).

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: array

fetchValue(string $statement, array $values = [])   X-Ref
Fetches the very first value (i.e., first column of the first row).

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: mixed

getParser()   X-Ref
Returns the Parser instance.

return: ParserInterface

getPdo()   X-Ref
Return the inner PDO (if any)

return: \PDO

getProfiler()   X-Ref
Returns the Profiler instance.

return: ProfilerInterface

inTransaction()   X-Ref
Is a transaction currently active?

return: bool

isConnected()   X-Ref
Is the PDO connection active?

return: bool

lastInsertId(?string $name = null)   X-Ref
Returns the last inserted autoincrement sequence value.

param: string|null $name The name of the sequence to check; typically needed
return: string|false

perform(string $statement, array $values = [])   X-Ref
Performs a query with bound values and returns the resulting
PDOStatement; array values will be passed through `quote()` and their
respective placeholders will be replaced in the query string.

param: string $statement The SQL statement to perform.
param: array $values Values to bind to the query
return: PDOStatement

prepare(string $query, array $options = [])   X-Ref
Prepares an SQL statement for execution.

param: string $query The SQL statement to prepare for execution.
param: array $options Set these attributes on the returned
return: PDOStatement|false

prepareWithValues(string $statement, array $values = [])   X-Ref
Prepares an SQL statement with bound values.

This method only binds values that have placeholders in the
statement, thereby avoiding errors from PDO regarding too many bound
values. It also binds all sequential (question-mark) placeholders.

If a placeholder value is an array, the array is converted to a string
of comma-separated quoted values; e.g., for an `IN (...)` condition.
The quoted string is replaced directly into the statement instead of
using `PDOStatement::bindValue()` proper.

param: string $statement The SQL statement to prepare for execution.
param: array $values The values to bind to the statement, if any.
return: PDOStatement

query(string $query, ?int $fetchMode = null, mixed ...$fetch_mode_args)   X-Ref
Queries the database and returns a PDOStatement.

param: string $query The SQL statement to prepare and execute.
param: int|null $fetchMode
param: mixed ...$fetch_mode_args Optional fetch-related parameters.
return: PDOStatement|false

quote(string|int|array|float|null $value, int $type = self::PARAM_STR)   X-Ref
Quotes a value for use in an SQL statement.

This differs from `PDO::quote()` in that it will convert an array into
a string of comma-separated quoted values.

param: string|int|array|float|null $value The value to quote.
param: int $type A data type hint for the database driver.
return: string|false The quoted value or false if the driver does not support quoting in this way.

quoteName(string $name)   X-Ref
Quotes a multi-part (dotted) identifier name.

param: string $name The multi-part identifier name.
return: string The multi-part identifier name, quoted.

quoteSingleName(string $name)   X-Ref
Quotes a single identifier name.

param: string $name The identifier name.
return: string The quoted identifier name.

rollBack()   X-Ref
Rolls back the current transaction, and restores autocommit mode.

return: bool True on success, false on failure.

setParser(ParserInterface $parser)   X-Ref
Sets the Parser instance.

param: ParserInterface $parser The Parser instance.

setProfiler(ProfilerInterface $profiler)   X-Ref
Sets the Profiler instance.

param: ProfilerInterface $profiler The Profiler instance.

yieldAll(string $statement, array $values = [])   X-Ref
Yields rows from the database.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: \Generator

yieldAssoc(string $statement, array $values = [])   X-Ref
Yields rows from the database keyed on the first column of each row.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: \Generator

yieldCol(string $statement, array $values = [])   X-Ref
Yields the first column of each row.

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: \Generator

yieldObjects(string $statement,array $values = [],string $class = 'stdClass',array $args = [])   X-Ref
Yields objects where the column values are mapped to object properties.

Warning: PDO "injects property-values BEFORE invoking the constructor -
in other words, if your class initializes property-values to defaults
in the constructor, you will be overwriting the values injected by
fetchObject() !"
<http://www.php.net/manual/en/pdostatement.fetchobject.php#111744>

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
param: string $class The name of the class to create from each
param: array $args Arguments to pass to each object constructor.
return: \Generator

yieldPairs(string $statement, array $values = [])   X-Ref
Yields key-value pairs (first column is the key, second column is the
value).

param: string $statement The SQL statement to prepare and execute.
param: array $values Values to bind to the query.
return: \Generator

bindValue(PDOStatement $sth, mixed $key, mixed $val)   X-Ref
Bind a value using the proper PDO::PARAM_* type.

param: PDOStatement $sth The statement to bind to.
param: mixed $key The placeholder key.
param: mixed $val The value to bind to the statement.
return: bool

newParser(string $driver)   X-Ref
Returns a new Parser instance.

param: string $driver Return a parser for this driver.
return: ParserInterface

setQuoteName(string $driver)   X-Ref
Sets quoting properties based on the PDO driver.

param: string $driver The PDO driver name.
return: void

getAttribute(int $attribute)   X-Ref
Retrieve a database connection attribute

param: int $attribute
return: bool|int|string|array|null

setAttribute(int $attribute, mixed $value)   X-Ref
Set a database connection attribute

param: int $attribute
param: mixed $value
return: bool



Generated: Sat Apr 26 05:10:07 2025 Cross-referenced by PHPXref 0.7.1