Public Member Functions | |
__construct ($dbaccess= '', $id= '', $res= '', $dbid=0) | |
Select ($id) | |
getValues () | |
affectColumn ($fields, $reset=true) | |
affect ($array, $more=false, $reset=true) | |
isAffected () | |
Complete () | |
preInsert () | |
postInsert () | |
preUpdate () | |
postUpdate () | |
preDelete () | |
postDelete () | |
preSelect ($id) | |
postSelect ($id) | |
Add ($nopost=false, $nopre=false) | |
modify ($nopost=false, $sfields="", $nopre=false) | |
delete ($nopost=false) | |
Adds (&$tcopy, $nopost=false) | |
lw ($prop) | |
CloseConnect () | |
Create ($nopost=false) | |
postInit () | |
init_dbid () | |
exec_query ($sql, $lvl=0, $prepare=false) | |
numrows () | |
fetch_array ($c, $type=PGSQL_ASSOC) | |
update () | |
setError ($moreerr= '') | |
autoUpdate () | |
savePoint ($point) | |
lockPoint ($exclusiveLock, $exclusiveLockPrefix= '') | |
setMasterLock ($useLock) | |
rollbackPoint ($point) | |
commitPoint ($point) | |
Data Fields | |
$dbid = - 1 | |
$dbaccess = '' | |
$fields | |
$dbtable = '' | |
$id_fields | |
$criterias = array() | |
$sup_fields = array() | |
$sup_where = array() | |
$sup_tables = array() | |
$fulltextfields = array() | |
$order_by = "" | |
$isset = false | |
$msg_err = '' | |
$err_code = '' | |
$res = '' | |
$debug = false | |
$sqlcreate | |
$sqlinit | |
$log | |
Static Public Attributes | |
static | $savepoint = array() |
static | $lockpoint = array() |
static | $sqlStrict = null |
Protected Member Functions | |
tryCreate () | |
This class is a generic DB Class that can be used to create objects based on the description of a DB Table. More Complex Objects will inherit from this basic Class.
Definition at line 28 of file Class.DbObj.php.
__construct | ( | $dbaccess = '' , |
|
$id = '' , |
|||
$res = '' , |
|||
$dbid = 0 |
|||
) |
Database Object constructor
string | $dbaccess | database specification |
int | array | $id | identifier of the object |
array | $res | array of result issue to QueryDb QueryDb::Query() |
resource | $dbid | the database connection resource |
Definition at line 113 of file Class.DbObj.php.
Add the object to the database
bool | $nopost | PostInsert method not apply if true |
bool | $nopre | PreInsert method not apply if true |
Definition at line 413 of file Class.DbObj.php.
Adds | ( | & | $tcopy, |
$nopost = false |
|||
) |
Add several objects to the database no post neither preInsert are called
bool | $nopost | PostInsert method not apply if true |
Definition at line 536 of file Class.DbObj.php.
affect | ( | $array, | |
$more = false , |
|||
$reset = true |
|||
) |
affect object with a set of values
array | $array | indexed array of values , index if the column attribute |
Definition at line 278 of file Class.DbObj.php.
affectColumn | ( | $fields, | |
$reset = true |
|||
) |
affect object specific column values from this item use only when object is already affected
array | $fields | sql field to affect |
Definition at line 245 of file Class.DbObj.php.
autoUpdate | ( | ) |
Definition at line 832 of file Class.DbObj.php.
CloseConnect | ( | ) |
Definition at line 567 of file Class.DbObj.php.
commitPoint | ( | $point | ) |
commit transaction save point
string | $point |
Definition at line 1061 of file Class.DbObj.php.
Complete | ( | ) |
Definition at line 303 of file Class.DbObj.php.
Create | ( | $nopost = false | ) |
delete | ( | $nopost = false | ) |
Delete the object on the database
bool | $nopost | PostUpdate() and method not apply if true |
Definition at line 501 of file Class.DbObj.php.
exec_query | ( | $sql, | |
$lvl = 0 , |
|||
$prepare = false |
|||
) |
Send a request to database
string | $sql | the query |
int | $lvl | level set to 0 (internal purpose only) |
bool | $prepare | set to true to use pg_prepare, restrict to use single query |
Dcp\Db\Exception | if query fail |
Definition at line 698 of file Class.DbObj.php.
fetch_array | ( | $c, | |
$type = PGSQL_ASSOC |
|||
) |
Definition at line 804 of file Class.DbObj.php.
getValues | ( | ) |
init_dbid | ( | ) |
isAffected | ( | ) |
verify that the object exists in database test if object has fields id set if true values of the object has been set @æpi test if object if affected
Definition at line 296 of file Class.DbObj.php.
lockPoint | ( | $exclusiveLock, | |
$exclusiveLockPrefix = '' |
|||
) |
Set a database transaction advisory lock
int | $exclusiveLock | Lock's identifier as a signed integer in the int32 range (i.e. in the range [-2147483648, 2147483647]). |
string | $exclusiveLockPrefix | Lock's prefix string limited up to 4 bytes. |
\Dcp\Exception | DB0010, DB0011, and DB0012 |
Definition at line 960 of file Class.DbObj.php.
lw | ( | $prop | ) |
Definition at line 562 of file Class.DbObj.php.
Save the object to the database
bool | $nopost | PostUpdate() and method not apply if true |
string | $sfields | only this column will ne updated if empty all fields |
bool | $nopre | PreUpdate() method not apply if true |
Definition at line 449 of file Class.DbObj.php.
numrows | ( | ) |
number of return rows after exec_query
Definition at line 795 of file Class.DbObj.php.
postDelete | ( | ) |
Method use after delete method
Definition at line 376 of file Class.DbObj.php.
postInit | ( | ) |
Definition at line 602 of file Class.DbObj.php.
postInsert | ( | ) |
Method use after Add method This method should be replaced by the Child Class
Definition at line 328 of file Class.DbObj.php.
postSelect | ( | $id | ) |
Method use after select method
mixed | $id | the id use by select |
Definition at line 399 of file Class.DbObj.php.
postUpdate | ( | ) |
Method use after Modify method This method should be replaced by the Child Class
Definition at line 354 of file Class.DbObj.php.
preDelete | ( | ) |
if return error message, deletion is aborded
Definition at line 365 of file Class.DbObj.php.
preInsert | ( | ) |
Method use before Add method This method should be replaced by the Child Class if return error message, modify is aborded
Definition at line 315 of file Class.DbObj.php.
preSelect | ( | $id | ) |
Method use before select method
mixed | $id | the id use by select |
Definition at line 388 of file Class.DbObj.php.
preUpdate | ( | ) |
Method use before Modify method This method should be replaced by the Child Class if return error message, modify is aborded
Definition at line 341 of file Class.DbObj.php.
rollbackPoint | ( | $point | ) |
revert to transaction save point
string | $point | revert point |
Definition at line 1031 of file Class.DbObj.php.
savePoint | ( | $point | ) |
set a database transaction save point
string | $point | point identifier |
\Dcp\Exception |
Definition at line 913 of file Class.DbObj.php.
Select | ( | $id | ) |
Select object from its fields if fields has more then one variable, need to use an array
int | array | $id |
Definition at line 161 of file Class.DbObj.php.
setError | ( | $moreerr = '' | ) |
setMasterLock | ( | $useLock | ) |
set a database master lock the lock is free when explicit call with false parameter. When a master lock is set,
bool | $useLock | set lock (true) or unlock (false) |
Definition at line 1007 of file Class.DbObj.php.
|
protected |
update | ( | ) |
$criterias = array() |
Definition at line 55 of file Class.DbObj.php.
$dbaccess = '' |
Definition at line 39 of file Class.DbObj.php.
$dbid = - 1 |
Definition at line 34 of file Class.DbObj.php.
$dbtable = '' |
Definition at line 51 of file Class.DbObj.php.
$debug = false |
Definition at line 94 of file Class.DbObj.php.
$err_code = '' |
Definition at line 86 of file Class.DbObj.php.
$fields |
Definition at line 44 of file Class.DbObj.php.
$fulltextfields = array() |
Definition at line 63 of file Class.DbObj.php.
$id_fields |
Definition at line 53 of file Class.DbObj.php.
$isset = false |
Definition at line 74 of file Class.DbObj.php.
|
static |
Definition at line 76 of file Class.DbObj.php.
$log |
Definition at line 100 of file Class.DbObj.php.
$msg_err = '' |
Definition at line 82 of file Class.DbObj.php.
$order_by = "" |
Definition at line 68 of file Class.DbObj.php.
$res = '' |
Definition at line 90 of file Class.DbObj.php.
|
static |
Definition at line 75 of file Class.DbObj.php.
$sqlcreate |
Definition at line 95 of file Class.DbObj.php.
$sqlinit |
Definition at line 96 of file Class.DbObj.php.
|
static |
Definition at line 78 of file Class.DbObj.php.
$sup_fields = array() |
Definition at line 60 of file Class.DbObj.php.
$sup_tables = array() |
Definition at line 62 of file Class.DbObj.php.
$sup_where = array() |
Definition at line 61 of file Class.DbObj.php.