nyroFwk  0.2
Static Public Member Functions | Data Fields | Static Protected Member Functions | Private Member Functions | Static Private Attributes
db Class Reference

Static Public Member Functions

static getInstance ($cfg=null)
 
static get ($type, $table, array $prm=array())
 
static getCfg ($key)
 
static isI18nName ($field)
 
static unI18nName ($field)
 
static log ($sql=null, $bind=null)
 

Data Fields

const FETCH_ASSOC = PDO::FETCH_ASSOC
 
const FETCH_BOTH = PDO::FETCH_BOTH
 
const FETCH_NUM = PDO::FETCH_NUM
 
const FETCH_ROWSET = PDO::FETCH_CLASS
 
const FETCH_COLUMN = PDO::FETCH_COLUMN
 

Static Protected Member Functions

static init ()
 

Private Member Functions

 __construct ()
 

Static Private Attributes

static $instances = array()
 
static $cfg = null
 
static $tables = array()
 
static $log = array()
 

Detailed Description

factory class for all dbo sources

Definition at line 10 of file db.class.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )
private

No instanciation for this class

Definition at line 49 of file db.class.php.

Member Function Documentation

◆ get()

static get (   $type,
  $table,
array  $prm = array() 
)
static

Get a db object

Parameters
string$typeElement type (table, rowset or row)
db_table | string$table
array$prmArray parameter for the factory
Returns
db_table|db_rowset|db_row

Definition at line 87 of file db.class.php.

◆ getCfg()

static getCfg (   $key)
static

Get a db configuration value

Parameters
string$keyKet value
Returns
mixed

Definition at line 125 of file db.class.php.

◆ getInstance()

static getInstance (   $cfg = null)
static

Get db instance

Parameters
string | array$cfgString if use a configuration (and retrieve a singleton) or array to have an unique connection. Array must contain key use to specify the type to use
Returns
db_abstract The instance requested

Definition at line 58 of file db.class.php.

◆ init()

static init ( )
staticprotected

Init the config object

Definition at line 168 of file db.class.php.

◆ isI18nName()

static isI18nName (   $field)
static

indicate if a field is i18n

Parameters
string$nameField name to test
Returns
bool

Definition at line 135 of file db.class.php.

◆ log()

static log (   $sql = null,
  $bind = null 
)
static

Add a new query log or get the whole array of log

Parameters
string | null$sqlThe query or null to get the whole log
array | null$bindValues Binded or null
Returns
void|array Array if $sql is null

Definition at line 156 of file db.class.php.

◆ unI18nName()

static unI18nName (   $field)
static

Remove the i18n indicator part of a field (if presente

Parameters
string$field
Returns
string

Definition at line 145 of file db.class.php.

Field Documentation

◆ $cfg

$cfg = null
staticprivate

Definition at line 30 of file db.class.php.

◆ $instances

$instances = array()
staticprivate

Definition at line 23 of file db.class.php.

◆ $log

$log = array()
staticprivate

Definition at line 44 of file db.class.php.

◆ $tables

$tables = array()
staticprivate

Definition at line 37 of file db.class.php.

◆ FETCH_ASSOC

const FETCH_ASSOC = PDO::FETCH_ASSOC

Definition at line 12 of file db.class.php.

◆ FETCH_BOTH

const FETCH_BOTH = PDO::FETCH_BOTH

Definition at line 13 of file db.class.php.

◆ FETCH_COLUMN

const FETCH_COLUMN = PDO::FETCH_COLUMN

Definition at line 16 of file db.class.php.

◆ FETCH_NUM

const FETCH_NUM = PDO::FETCH_NUM

Definition at line 14 of file db.class.php.

◆ FETCH_ROWSET

const FETCH_ROWSET = PDO::FETCH_CLASS

Definition at line 15 of file db.class.php.


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:20 for nyroFwk by doxygen 1.8.13