PDO

Extends \PDO

Extends to default `PDO` class with capabilities used by other HotMelt classes.

Extensions include a wrapper around \PDO::prepare() that wraps statements in an instance of \HotMelt\PDOStatementDecorator and support for quoting identifiers (\HotMelt\PDO::quoteIdentifier()).

Methods

Conveniently create a PDO object using the MySQL driver.

mySQL(string $host, string $db, string $user, string $password) : \HotMelt\PDO
static

This method will also configure the connection to use the UTF-8 character encoding.

Arguments

$host

string

The host to connect to.

$db

string

The name of the database to use.

$user

string

The user name to use for authentication.

$password

string

The password to use for authentication.

Response

\HotMelt\PDO

Conveniently create a PDO object using the MySQL driver.

sqlite(string $path) : \HotMelt\PDO
static

This method will also configure the connection to use the UTF-8 character encoding.

Arguments

$path

string

The path to the Sqlite database file.

Response

\HotMelt\PDO

Quotes a string representing an identifier, e.g. a table or column name, for direct injection into a query string.

quoteIdentifier(string $identifier) : string

Arguments

$identifier

string

The identifier to quote.

Response

string

Properties

The DSN used to initialize the PDO object.

dsn : 
type

string