Amanu
Projektmanagement für Selbstständige und Freelancer
DBAL Class Reference

Public Member Functions

 prepare ($query)
 
 dynamicInsert ($table, array $columns, array $data)
 
 dynamicUpdate ($table, array $where, array $columns, array $data)
 
 deleteRow ($table, array $where)
 
 simpleSelect ($table, array $columns, array $where=NULL, $limit=0, $orderBy=NULL)
 

Static Public Member Functions

static getInstance ()
 

Static Protected Attributes

static $instance
 

Private Member Functions

 __clone ()
 
 __construct ()
 

Detailed Description

Database Abstraction Layer, uses PDO, implements Singleton pattern (we only want ONE DB connection)

This file is part of the project codename "AMANUENSIS"

Author
Sebastian Antosch s.ant.nosp@m.osch.nosp@m.@i-sa.nosp@m.n.de

Constructor & Destructor Documentation

__construct ( )
private

Constructor will create the Database connection

Member Function Documentation

static getInstance ( )
static

Will return the instance of the DBAL

Returns
DBAL- a DBAL object
__clone ( )
private

Manage proper cloning

Returns
DBAL - a DBAL instance
prepare (   $query)

Returns a PDO prepared statement

Parameters
String$query- the query to be prepared
Returns
PDOstatement
dynamicInsert (   $table,
array  $columns,
array  $data 
)

Takes a tablename, a list of column names to be inserted and and array of data containing the data that should be inserted

Parameters
string$table- the name of the table to insert into,
array$columns- the column names that should be inserted
array$data- an array that holds the data that should be inserted
Returns
int - the id of the inserted row
dynamicUpdate (   $table,
array  $where,
array  $columns,
array  $data 
)

Takes a tablename, a list of column names to be inserted and and array of data containing the data that should be inserted

Parameters
string$table- the name of the table to insert into,
array$where- column:value for the where clause
array$columns- the column names that should be inserted
array$data- an array that holds the data that should be inserted
Returns
int - the id of the inserted row
deleteRow (   $table,
array  $where 
)

Takes a tablename and a where representation that should be deleted

Parameters
string$table- the name of the table to insert into,
array$where- column:value for the where clause
Exceptions
Exception
Returns
int rowCount - the number of rows deleted
simpleSelect (   $table,
array  $columns,
array  $where = NULL,
  $limit = 0,
  $orderBy = NULL 
)

Takes a tablename and a where representation and a set of columnnames and performs a simple SELECT

Parameters
string$table- the name of the table to insert into,
array$columns- the columns to be responded
array$where- column:value for the where clause
int$limit- limits the select to X, 0 = no limit
string$orderBy- an optional order by statement
Exceptions
Exception
Returns
array - (2-dimensional)

Field Documentation

$instance
staticprotected

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