inc\classes\db.phpView Source

Show: PublicProtectedPrivateinherited
Table of Contents
Data Base

Connction to DB and db class setup

Author
Sergey Dilong  
License
GPL-2.0  
Package
Temply-Account\Services  
\ExceptionapiException * [100] DB Connection error * [100] Incorrect DB credentials

Constants

>VConstant  DBCHARSET = 'utf8mb4'
Database text encoding
Package
Temply-Account\Services  
>VConstant  DBDSN = 'mysql:host=' . DBHOST . ';dbname=' . DBNAME . ';charset=' . DBCHARSET
Auth data string for PDO
Package
Temply-Account\Services  
>VConstant  DBOPT = array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_LAZY, \PDO::ATTR_EMULATE_PREPARES => false)
PDO global settings
Package
Temply-Account\Services  
>VConstant  DB_CONNECTION_SUCCESS = true
Connection success status
Package
Temply-Account\Services  

\db

Package: Temply-Account\Services
DB utils and autoload via classes

Calls PDO connection by autoload

Author
Sergey Dilong  
License
GPL-2.0  

Methods

methodpublicvalues(array $a) : string
static

Generate SET operator

Automize generation of SET operator in SQL queries for PDO

["a" => "foo", "b" => "bar"] turns to `a` = :a, `b` = :b for PDO::execute()

Parameters
NameTypeDescription
$aarray

Input array

Returns
TypeDescription
stringA string for preparation query
Documentation was generated by phpDocumentor v2.9.0.