dolibarr 21.0.0-alpha
CProductNature Class Reference

Class of dictionary of nature of product (used by imports) More...

Inheritance diagram for CProductNature:
Collaboration diagram for CProductNature:

Public Member Functions

 __construct ($db)
 Constructor.
 
 create ($user, $notrigger=0)
 Create object into database.
 
 fetch ($id, $code='')
 Load object in memory from database.
 
 fetchAll ($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
 Load list of objects in memory from the database.
 
 update ($user=null, $notrigger=0)
 Update object into database.
 
 delete ($user, $notrigger=0)
 Delete object in database.
 
 getProductNatureFromCode ($code, $mode='code')
 Get unit from code.
 

Detailed Description

Class of dictionary of nature of product (used by imports)

Definition at line 33 of file cproductnature.class.php.

Constructor & Destructor Documentation

◆ __construct()

CProductNature::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 56 of file cproductnature.class.php.

Member Function Documentation

◆ create()

CProductNature::create ( $user,
$notrigger = 0 )

Create object into database.

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

Definition at line 69 of file cproductnature.class.php.

References dol_syslog().

◆ delete()

CProductNature::delete ( $user,
$notrigger = 0 )

Delete object in database.

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

Definition at line 282 of file cproductnature.class.php.

References dol_syslog().

◆ fetch()

CProductNature::fetch ( $id,
$code = '' )

Load object in memory from database.

Parameters
int$idId of CUnit object to fetch (rowid)
string$codeCode
Returns
int Return integer <0 if KO, >0 if OK

Definition at line 111 of file cproductnature.class.php.

◆ fetchAll()

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

Load list of objects in memory from the database.

Parameters
string$sortorderSort Order
string$sortfieldSort field
int$limitLimit
int$offsetOffset
string$filterFilter USF
string$filtermodeFilter mode (AND or OR)
Returns
array|int int <0 if KO, array of pages if OK

Definition at line 163 of file cproductnature.class.php.

References dol_syslog(), and forgeSQLFromUniversalSearchCriteria().

◆ getProductNatureFromCode()

CProductNature::getProductNatureFromCode ( $code,
$mode = 'code' )

Get unit from code.

Parameters
int$codecode of unit
string$mode0= id , short_label=Use short label as value, code=use code
Returns
int Return integer <0 if KO, Id of code if OK

Definition at line 313 of file cproductnature.class.php.

References dol_getIdFromCode().

◆ update()

CProductNature::update ( $user = null,
$notrigger = 0 )

Update object into database.

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

Definition at line 247 of file cproductnature.class.php.

References dol_syslog().


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