dolibarr  16.0.5
Public Member Functions | List of all members
CProductNature Class Reference

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

Public Member Functions

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

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.

References db.

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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


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