Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
DbObj Class Reference
+ Inheritance diagram for DbObj:
+ Collaboration diagram for DbObj:

Public Member Functions

 __construct ($dbaccess= '', $id= '', $res= '', $dbid=0)
 
 Select ($id)
 
 getValues ()
 
 AffectColumn ($fields)
 
 Affect ($array)
 
 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 ()
 
 savePoint ($point)
 
 rollbackPoint ($point)
 
 commitPoint ($point)
 

Data Fields

 $dbid = - 1
 
 $dbaccess = ''
 
 $fields
 
 $dbtable = ''
 
 $criterias = array()
 
 $sup_fields = array()
 
 $sup_where = array()
 
 $sup_tables = array()
 
 $fulltextfields = array()
 
 $order_by = ""
 
 $isset = false
 
 $msg_err = ''
 
 $err_code = ''
 
 $res = null
 
 $debug = false
 

Static Public Attributes

static $savepoint = array()
 

Detailed Description

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 30 of file Class.DbObj.php.

Constructor & Destructor Documentation

__construct (   $dbaccess = '',
  $id = '',
  $res = '',
  $dbid = 0 
)

Database Object constructor

Parameters
string$dbaccessdatabase specification
int$ididentificator of the object
array$resarray of result issue to QueryDb QueryDb::Query()
resource$dbidthe database connection resource
Returns
bool false if error occured

Definition at line 104 of file Class.DbObj.php.

+ Here is the call graph for this function:

Member Function Documentation

Add (   $nopost = false,
  $nopre = false 
)

Add the object to the database

Parameters
bool$nopostPostInsert method not apply if true
bool$nopostPreInsert method not apply if true
Returns
string error message, if no error empty string
See Also
PreInsert()
PostInsert()

Definition at line 362 of file Class.DbObj.php.

+ Here is the call graph for this function:

Adds ( $tcopy,
  $nopost = false 
)

Add several objects to the database no post neither preInsert are called

Parameters
bool$nopostPostInsert method not apply if true
Returns
string error message, if no error empty string
See Also
PreInsert()
PostInsert()

Definition at line 481 of file Class.DbObj.php.

+ Here is the call graph for this function:

Affect (   $array)

Definition at line 257 of file Class.DbObj.php.

+ Here is the call graph for this function:

AffectColumn (   $fields)

affect object specific column values from this item use only when object is already affected

Parameters
array$fieldssql field to affect
Returns
bool true if OK false else

Definition at line 227 of file Class.DbObj.php.

+ Here is the call graph for this function:

CloseConnect ( )

Definition at line 512 of file Class.DbObj.php.

commitPoint (   $point)

commit transaction save point

Parameters
string$point
Returns
string error message

Definition at line 835 of file Class.DbObj.php.

+ Here is the call graph for this function:

Complete ( )

Definition at line 279 of file Class.DbObj.php.

Create (   $nopost = false)

Definition at line 518 of file Class.DbObj.php.

+ Here is the call graph for this function:

Delete (   $nopost = false)

Definition at line 446 of file Class.DbObj.php.

+ Here is the call graph for this function:

exec_query (   $sql,
  $lvl = 0,
  $prepare = false 
)
Parameters
string$sqlthe query
int$lvllevel set to 0
bool$prepareset to true to use pg_prepare, restrict to use single query
Returns
string error message

Definition at line 567 of file Class.DbObj.php.

+ Here is the call graph for this function:

fetch_array (   $c,
  $type = PGSQL_ASSOC 
)

Definition at line 705 of file Class.DbObj.php.

getValues ( )

get all values in array

Returns
array

Definition at line 213 of file Class.DbObj.php.

init_dbid ( )

Definition at line 551 of file Class.DbObj.php.

+ Here is the call graph for this function:

isAffected ( )

verify that the object exists

if true values of the object has been set

Returns
bool

Definition at line 274 of file Class.DbObj.php.

lw (   $prop)

Definition at line 507 of file Class.DbObj.php.

Modify (   $nopost = false,
  $sfields = "",
  $nopre = false 
)

Add the object to the database

Parameters
bool$nopostPostUpdate() and method not apply if true
string$sfieldsonly this column will ne updated if empty all fields
bool$noprePreUpdate() method not apply if true
Returns
string error message, if no error empty string
See Also
PreUpdate()
PostUpdate()

Definition at line 398 of file Class.DbObj.php.

+ Here is the call graph for this function:

numrows ( )

Definition at line 696 of file Class.DbObj.php.

PostDelete ( )

Definition at line 339 of file Class.DbObj.php.

PostInit ( )

Definition at line 547 of file Class.DbObj.php.

PostInsert ( )

Method use after Add method This method should be replaced by the Child Class

Returns
string error message, if no error empty string, if message error not empty the Add method is not completed
See Also
Add()

Definition at line 304 of file Class.DbObj.php.

PostSelect (   $id)

Definition at line 349 of file Class.DbObj.php.

PostUpdate ( )

Method use after Modify method This method should be replaced by the Child Class

Returns
string error message, if no error empty string, if message error not empty the Modify method is not completed
See Also
Modify()

Definition at line 329 of file Class.DbObj.php.

PreDelete ( )

Definition at line 334 of file Class.DbObj.php.

PreInsert ( )

Method use before Add method This method should be replaced by the Child Class

Returns
string error message, if no error empty string
See Also
Add()

Definition at line 291 of file Class.DbObj.php.

PreSelect (   $id)

Definition at line 344 of file Class.DbObj.php.

PreUpdate ( )

Method use before Modify method This method should be replaced by the Child Class

Returns
string error message, if no error empty string
See Also
Modify()

Definition at line 316 of file Class.DbObj.php.

rollbackPoint (   $point)

revert to transaction save point

Parameters
string$point
Returns
string error message

Definition at line 812 of file Class.DbObj.php.

+ Here is the call graph for this function:

savePoint (   $point)

set a database transaction save point

Parameters
string$point
Returns
string error message

Definition at line 790 of file Class.DbObj.php.

+ Here is the call graph for this function:

Select (   $id)

Definition at line 144 of file Class.DbObj.php.

+ Here is the call graph for this function:

Update ( )

Definition at line 711 of file Class.DbObj.php.

+ Here is the call graph for this function:

Field Documentation

$criterias = array()

Definition at line 55 of file Class.DbObj.php.

$dbaccess = ''

Definition at line 41 of file Class.DbObj.php.

$dbid = - 1

Definition at line 36 of file Class.DbObj.php.

$dbtable = ''

Definition at line 53 of file Class.DbObj.php.

Definition at line 91 of file Class.DbObj.php.

$err_code = ''

Definition at line 83 of file Class.DbObj.php.

$fields
Initial value:
= array(
'*'
)

Definition at line 46 of file Class.DbObj.php.

$fulltextfields = array()

Definition at line 63 of file Class.DbObj.php.

$isset = false

Definition at line 74 of file Class.DbObj.php.

$msg_err = ''

Definition at line 79 of file Class.DbObj.php.

$order_by = ""

Definition at line 68 of file Class.DbObj.php.

$res = null

Definition at line 87 of file Class.DbObj.php.

$savepoint = array()
static

Definition at line 75 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.


The documentation for this class was generated from the following file:
← centre documentaire © anakeen - published under CC License - Dynacase