[ 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: 1022 lines (26 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($name, array $arguments)   X-Ref
Proxies to PDO methods created for specific drivers; in particular,
`sqlite` and `pgsql`.

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

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

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

return: array

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

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

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

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

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

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

fetchAssoc($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.

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

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

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

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

return: array
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

fetchObject($statement,array $values = [],$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>

return: object|false
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.

fetchObjects($statement,array $values = [],$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>

return: array
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.

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

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

fetchPairs($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).

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

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

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

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($name = null)   X-Ref
Returns the last inserted autoincrement sequence value.

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

perform($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.

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

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

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

prepareWithValues($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.

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

query($statement, ...$fetch)   X-Ref
Queries the database and returns a PDOStatement.

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

quote($value, $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.

return: string|false The quoted value.
param: mixed $value The value to quote.
param: int $type A data type hint for the database driver.

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

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

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

return: string The quoted identifier name.
param: string $name The 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($statement, array $values = [])   X-Ref
Yields rows from the database.

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

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

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

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

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

yieldObjects($statement,array $values = [],$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>

return: \Generator
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.

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

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

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

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

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

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

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

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

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

return: mixed
param: int $attribute

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

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



Generated: Tue Jan 21 05:10:11 2025 Cross-referenced by PHPXref 0.7.1