dolibarr  20.0.0-alpha
Public Member Functions | List of all members
CGenericDic Class Reference

Class CGenericDic. More...

Inheritance diagram for CGenericDic:
Inheritance graph
[legend]
Collaboration diagram for CGenericDic:
Collaboration graph
[legend]

Public Member Functions

 __construct (DoliDB $db)
 Constructor. More...
 
 create (User $user, $notrigger=0)
 Create object into database. More...
 
 fetch ($id, $code='', $label='')
 Load object in memory from the database. More...
 
 fetchAll ($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
 Load object in memory from the database. More...
 
 update (User $user, $notrigger=0)
 Update object into database. More...
 
 delete (User $user, $notrigger=0)
 Delete object in database. More...
 
 createFromClone (User $user, $fromid)
 Load an object from its id and create a new one in database. More...
 
 initAsSpecimen ()
 Initialise object with example values Id must be 0 if object instance is a specimen. More...
 

Detailed Description

Class CGenericDic.

Definition at line 34 of file cgenericdic.class.php.

Constructor & Destructor Documentation

◆ __construct()

CGenericDic::__construct ( DoliDB  $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 66 of file cgenericdic.class.php.

Member Function Documentation

◆ create()

CGenericDic::create ( User  $user,
  $notrigger = 0 
)

Create object into database.

Parameters
User$userUser that creates
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, Id of created object if OK

Definition at line 80 of file cgenericdic.class.php.

◆ createFromClone()

CGenericDic::createFromClone ( User  $user,
  $fromid 
)

Load an object from its id and create a new one in database.

Parameters
User$userUser making the clone
int$fromidId of object to clone
Returns
int New id of clone

Definition at line 442 of file cgenericdic.class.php.

◆ delete()

CGenericDic::delete ( User  $user,
  $notrigger = 0 
)

Delete object in database.

Parameters
User$userUser that deletes
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 389 of file cgenericdic.class.php.

◆ fetch()

CGenericDic::fetch (   $id,
  $code = '',
  $label = '' 
)

Load object in memory from the database.

Parameters
int$idId object
string$codecode
string$labelLabel
Returns
int Return integer <0 if KO, 0 if not found, >0 if OK

Definition at line 160 of file cgenericdic.class.php.

References dol_syslog().

◆ fetchAll()

CGenericDic::fetchAll (   $sortorder = '',
  $sortfield = '',
  $limit = 0,
  $offset = 0,
  $filter = '',
  $filtermode = 'AND' 
)

Load object in memory from the database.

Parameters
string$sortorderSort Order
string$sortfieldSort field
int$limitLimit
int$offsetoffset limit
string | array$filterfilter USF
string$filtermodefilter mode (AND or OR)
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 232 of file cgenericdic.class.php.

◆ initAsSpecimen()

CGenericDic::initAsSpecimen ( )

Initialise object with example values Id must be 0 if object instance is a specimen.

Returns
int

Definition at line 490 of file cgenericdic.class.php.

References code.

◆ update()

CGenericDic::update ( User  $user,
  $notrigger = 0 
)

Update object into database.

Parameters
User$userUser that modifies
int$notrigger0=launch triggers after, 1=disable triggers
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 314 of file cgenericdic.class.php.


The documentation for this class was generated from the following file: