Public Member Functions | |
__construct ($db, $logger) | |
query ($sql, $result=false) | |
escape ($str) | |
get_data_array ($res) | |
get_data_named ($res) | |
get_id () | |
count ($res) | |
Protected Attributes | |
$db | |
db connection resource | |
$logger | |
LogMaster object. | |
Private Member Functions | |
virtual_error ($method) |
Pure virtual class. Functionality must be defined in child classes.
__construct | ( | $ | db, | |
$ | logger | |||
) |
constructor
db | db resource | |
logger | LogMaster object |
count | ( | $ | res | ) |
return count of records affected by previou operation
res | sql result resource |
Reimplemented in MySQLDBWrapper, and PostgreDBWrapper.
escape | ( | $ | str | ) |
escapes data according DB rules
str | string of data |
Reimplemented in MySQLDBWrapper, and PostgreDBWrapper.
get_data_array | ( | $ | res | ) |
return array of data from dataset
res | sql result resource |
Reimplemented in MySQLDBWrapper, and PostgreDBWrapper.
get_data_named | ( | $ | res | ) |
return hash of data from dataset
res | sql result resource |
Reimplemented in MySQLDBWrapper, and PostgreDBWrapper.
get_id | ( | ) |
return id of previously inserted record
Reimplemented in MySQLDBWrapper, and PostgreDBWrapper.
query | ( | $ | sql, | |
$ | result = false | |||
) |
exec sql query
if result specified, function takes data from specified column of first row in dataset and returns it
sql | sql string | |
result | optional, index of column, from which data need to be returned |
Reimplemented in MySQLDBWrapper, and PostgreDBWrapper.
virtual_error | ( | $ | method | ) | [private] |
check that class method correctly re-defined
probably there are better ways to implement the same use-case
method | name of method |
$db [protected] |
db connection resource
$logger [protected] |
LogMaster object.