dolibarr 18.0.6
CProductNature Class Reference

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

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, array $filter=array(), $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 29 of file cproductnature.class.php.

Constructor & Destructor Documentation

◆ __construct()

CProductNature::__construct ( $db)

Constructor.

Parameters
DoliDb$dbDatabase handler

Definition at line 87 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 <0 if KO, Id of created object if OK

Definition at line 100 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 <0 if KO, >0 if OK

Definition at line 300 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 <0 if KO, >0 if OK

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

◆ fetchAll()

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

Load list of objects in memory from the database.

Parameters
string$sortorderSort Order
string$sortfieldSort field
int$limitlimit
int$offsetOffset
array$filterFilter array. Example array('field'=>'valueforlike', 'customurl'=>...)
string$filtermodeFilter mode (AND or OR)
Returns
array|int int <0 if KO, array of pages if OK

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

References dol_syslog().

◆ 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 <0 if KO, Id of code if OK

Definition at line 331 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 <0 if KO, >0 if OK

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

References dol_syslog().


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