|
| | 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) |
| |
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
- Copyright
- 2015 I-SAN.de Webdesign & Hosting GbR GPL
Constructor will create the Database connection
Will return the instance of the DBAL
- Returns
- DBAL- a DBAL object
Manage proper cloning
- Returns
- DBAL - a DBAL instance
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
-
- 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
-
- Returns
- array - (2-dimensional)
The documentation for this class was generated from the following file:
- D:/Arbeit/PhpStormProjects/amanuensis/app/classes/database/dbal.php