Overview

Namespaces

  • Alchemy
    • core
      • query
      • schema
    • dialect
    • engine
    • orm
    • tests
    • util
      • promise
  • PHP

Classes

  • Engine
  • ResultSet

Interfaces

  • IEngine
  • IResultSet
  • Overview
  • Namespace
  • Class
  • Tree

Class Engine

Basic Engine implementation using PDO as it's DBAPI layer

Alchemy\engine\Engine implements Alchemy\engine\IEngine
Namespace: Alchemy\engine
Located at alchemy/engine/Engine.php
Methods summary
public
# __construct( Alchemy\dialect\Compiler $compiler, string $dsn, string $username = '', mixed $password = '' )

Object constructor. Opens a connection to the database using PDO

Object constructor. Opens a connection to the database using PDO

Parameters

$compiler
string
$dsn See PDO documentation for DSN reference
$dsn
string
$username
$username
string
$password
$password
public
# beginTransaction( )

Start an atomic transaction on the database. These should generally not be held open very long in order to prevent deadlocks

Start an atomic transaction on the database. These should generally not be held open very long in order to prevent deadlocks

Implementation of

Alchemy\engine\IEngine::beginTransaction()
public
# commitTransaction( )

Commit a transaction as complete

Commit a transaction as complete

Implementation of

Alchemy\engine\IEngine::commitTransaction()
protected integer
# getBindParamType( object $obj )

Get the PDO bind-parameter type (default PARAM_STR) for an object

Get the PDO bind-parameter type (default PARAM_STR) for an object

Parameters

$obj
object
$obj

Returns

integer
protected
# echoQuery( string $sql, mixed $params )

Log a SQL statement if echo is enabled

Log a SQL statement if echo is enabled

Parameters

$sql
string
$sql
$params
public Alchemy\engine\ResultSet
# query( Alchemy\core\query\IQuery $query )

Compile and run a SQL expression on the database

Compile and run a SQL expression on the database

Parameters

$query
Alchemy\core\query\IQuery
Query to compile

Returns

Alchemy\engine\ResultSet

Implementation of

Alchemy\engine\IEngine::query()
public Alchemy\engine\ResultSet
# execute( string $sql, array $params = array() )

Execute raw SQL on the database connection

Execute raw SQL on the database connection

Parameters

$sql
string
$sql Statement string
$params
array
$params Params to bind to statement

Returns

Alchemy\engine\ResultSet

Implementation of

Alchemy\engine\IEngine::execute()
public
# rollbackTransaction( )

Revert a pending transaction on the database

Revert a pending transaction on the database

Implementation of

Alchemy\engine\IEngine::rollbackTransaction()
public
# setEcho( mixed $echoQueries )

Optionally enable echo'ing of SQL run on the RDBMS.

Optionally enable echo'ing of SQL run on the RDBMS.

Parameters

$echoQueries
mixed
$echoQueries False to disable. True to log to STDOUT. Callable to enable custom logging
Properties summary
protected mixed $compiler
#
protected mixed $connector
#
protected boolean $echoQueries false
#
protected boolean $pendingTransaction false
#
API documentation generated by ApiGen 2.8.0