dolibarr 25.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.
 
- Public Member Functions inherited from CommonDict
 errorsToString ()
 Method to output saved errors.
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ __construct()

CProductNature::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 57 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 70 of file cproductnature.class.php.

References active, and 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 $conf, and 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 113 of file cproductnature.class.php.

References active.

◆ 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|array<string,mixed>$filter Filter USF
string$filtermodeFilter mode (AND or OR)
Returns
CProductNature[]|int<-1,-1> 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 $conf, active, and dol_syslog().


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