Hoa central
Public Member Functions | List of all members
Hoa\Database\IDal\Wrapper Interface Reference
Inheritance diagram for Hoa\Database\IDal\Wrapper:

Public Member Functions

 __construct ($dsn, $username, $password, Array $driverOption=[])
 
 beginTransaction ()
 
 commit ()
 
 rollBack ()
 
 lastInsertId ($name=null)
 
 prepare ($statement, Array $options=[])
 
 quote ($string=null, $type=-1)
 
 query ($statement)
 
 errorCode ()
 
 errorInfo ()
 
 getAvailableDrivers ()
 
 setAttributes (Array $attributes)
 
 setAttribute ($attribute, $value)
 
 getAttributes ()
 
 getAttribute ($attribute)
 

Detailed Description

Interface .

Interface of a DAL wrapper.

Definition at line 47 of file Wrapper.php.

Constructor & Destructor Documentation

Hoa\Database\IDal\Wrapper::__construct (   $dsn,
  $username,
  $password,
Array  $driverOption = [] 
)

Create a DAL instance, representing a connection to a database.

Parameters
string$dsnThe DSN of database.
string$usernameThe username to connect to database.
string$passwordThe password to connect to database.
array$driverOptionsThe driver options.
Returns
void
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Member Function Documentation

Hoa\Database\IDal\Wrapper::beginTransaction ( )

Initiate a transaction.

Returns
bool
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::commit ( )

Commit a transaction.

Returns
bool
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::errorCode ( )

Fetch the SQLSTATE associated with the last operation on the database handle.

Returns
string
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::errorInfo ( )

Fetch extends error information associated with the last operation on the database handle.

Returns
array
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::getAttribute (   $attribute)

Retrieve a database connection attribute.

Parameters
string$attributeAttribute name.
Returns
mixed
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::getAttributes ( )

Retrieve all database connection attributes.

Returns
array
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::getAvailableDrivers ( )

Return an array of available drivers.

Returns
array
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::lastInsertId (   $name = null)

Return the ID of the last inserted row or sequence value.

Parameters
string$nameName of sequence object (needed for some driver).
Returns
string
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::prepare (   $statement,
Array  $options = [] 
)

Prepare a statement for execution and returns a statement object.

Parameters
string$statementThis must be a valid SQL statement for the target database server.
array$optionsOptions to set attributes values for the AbstractLayer Statement.
Returns
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::query (   $statement)

Execute an SQL statement, returning a result set as a object.

Parameters
string$statementThe SQL statement to prepare and execute.
Returns
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::quote (   $string = null,
  $type = -1 
)

Quote a string for use in a query.

Parameters
string$stringThe string to be quoted.
int$typeProvide a data type hint for drivers that have alternate quoting styles.
Returns
string
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::rollBack ( )

Roll back a transaction.

Returns
bool
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::setAttribute (   $attribute,
  $value 
)

Set a specific attribute.

Parameters
mixed$attributeAttribute name.
mixed$valueAttribute value.
Returns
mixed
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.

Hoa\Database\IDal\Wrapper::setAttributes ( Array  $attributes)

Set attributes.

Parameters
array$attributesAttributes values.
Returns
array
Exceptions

Implemented in Hoa\Database\Layer\Pdo\Pdo.


The documentation for this interface was generated from the following file: