|
static | add ($options, $name= 'default') |
| Adds a connection to the manager, will trigger an error if connection name is already present. More...
|
|
static | getConnection ($name=null) |
| Retrieves connection details previously configured. More...
|
|
static | getPdo ($name) |
| Retrieves the Pdo object. More...
|
|
static | getQB ($name) |
| Retreives the query builder object if present. More...
|
|
static | __callStatic ($method, $args=null) |
| Calls Pdo or query builder methods from the default connection directly. More...
|
|
static __callStatic |
( |
|
$method, |
|
|
|
$args = null |
|
) |
| |
|
static |
Calls Pdo or query builder methods from the default connection directly.
- Parameters
-
string | $method | the name of the method to call |
array | $args | arguments for the method |
Definition at line 99 of file PtcDb.php.
static _checkConnectionName |
( |
|
$name | ) |
|
|
staticprotected |
Checks if a given connection exists.
- Parameters
-
string | $name | the name of the connection to check |
- Returns
- true if connection exists, false otherwise
Definition at line 189 of file PtcDb.php.
static _debug |
( |
|
$string, |
|
|
|
$statement = null , |
|
|
|
$category = null |
|
) |
| |
|
staticprotected |
Sends messsages to the PtcDebug class if present.
- Parameters
-
mixed | $string | the string to pass |
mixed | $statement | some statement if required |
string | $category | some category |
Definition at line 219 of file PtcDb.php.
static _initializeConnection |
( |
|
$name | ) |
|
|
staticprotected |
Initializes the pdo and query builder obejcts.
- Parameters
-
string | $name | the name of the connection |
Definition at line 150 of file PtcDb.php.
static _pdoDriver |
( |
|
$driver, |
|
|
|
$host |
|
) |
| |
|
staticprotected |
Builds the pdo driver.
- Parameters
-
string | $driver | the driver type |
string | $host | the database server host |
- Returns
- the Pdo driver
Definition at line 205 of file PtcDb.php.
static add |
( |
|
$options, |
|
|
|
$name = 'default' |
|
) |
| |
|
static |
Adds a connection to the manager, will trigger an error if connection name is already present.
See Getting Started
- Parameters
-
array | $options | the details of the connection, see Connection Options |
string | $name | the name of the connection |
- Returns
- an array with the connection details as values or false if name is already present
Definition at line 22 of file PtcDb.php.
static getConnection |
( |
|
$name = null | ) |
|
|
static |
Retrieves connection details previously configured.
See Getting Connection Details
- Parameters
-
string | $name | the name of the connection to retrieve |
- Returns
- an array with the connection as values if $name is set, otherwise all connections set
Definition at line 58 of file PtcDb.php.
Retreives the query builder object if present.
See Using the Query Builder
- Parameters
-
string | $name | the name of the connection |
- Returns
- the query builder object
Definition at line 80 of file PtcDb.php.
Initial value:= array
(
'name' => 'default' ,
'driver' => 'mysql' ,
'user' => 'root' ,
'pass' => '' ,
'host' => 'localhost' ,
'db' => 'database' ,
'charset' => 'utf8' ,
'query_builder' => false ,
'query_builder_class' => 'PtcQueryBuilder' ,
'pdo_attributes' => array
(
PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING ,
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ
)
)
Default connection options property, see Connection Options.
Definition at line 121 of file PtcDb.php.
Pdo and query builder objects property.
Definition at line 141 of file PtcDb.php.
$_connectionsDetails = array( ) |
|
staticprotected |
Connection details property.
Definition at line 145 of file PtcDb.php.
The documentation for this class was generated from the following file: