dolibarr 18.0.6
|
Class of dictionary type of thirdparty (used by imports) More...
Public Member Functions | |
__construct ($db) | |
Constructor. | |
create ($user, $notrigger=0) | |
Create object into database. | |
fetch ($id, $code='', $short_label='', $unit_type='') | |
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. | |
getUnitFromCode ($code, $mode='code', $unit_type='') | |
Get unit from code. | |
unitConverter ($value, $fk_unit, $fk_new_unit=0) | |
Unit converter. | |
scaleOfUnitPow ($id) | |
Get scale of unit factor. | |
Class of dictionary type of thirdparty (used by imports)
Definition at line 28 of file cunits.class.php.
CUnits::__construct | ( | $db | ) |
CUnits::create | ( | $user, | |
$notrigger = 0 ) |
Create object into database.
Definition at line 83 of file cunits.class.php.
References dol_syslog().
CUnits::delete | ( | $user, | |
$notrigger = 0 ) |
Delete object in database.
Definition at line 389 of file cunits.class.php.
References dol_syslog().
CUnits::fetch | ( | $id, | |
$code = '', | |||
$short_label = '', | |||
$unit_type = '' ) |
Load object in memory from database.
int | $id | Id of CUnit object to fetch (rowid) |
string | $code | Code |
string | $short_label | Short Label ('g', 'kg', ...) |
string | $unit_type | Unit type ('size', 'surface', 'volume', 'weight', ...) |
Definition at line 169 of file cunits.class.php.
CUnits::fetchAll | ( | $sortorder = '', | |
$sortfield = '', | |||
$limit = 0, | |||
$offset = 0, | |||
array | $filter = array(), | ||
$filtermode = 'AND' ) |
Load list of objects in memory from the database.
string | $sortorder | Sort Order |
string | $sortfield | Sort field |
int | $limit | limit |
int | $offset | Offset |
array | $filter | Filter array. Example array('field'=>'valueforlike', 'customurl'=>...) |
string | $filtermode | Filter mode (AND or OR) |
Definition at line 235 of file cunits.class.php.
References dol_syslog().
CUnits::getUnitFromCode | ( | $code, | |
$mode = 'code', | |||
$unit_type = '' ) |
Get unit from code.
string | $code | code of unit |
string | $mode | 0= id , short_label=Use short label as value, code=use code |
string | $unit_type | weight,size,surface,volume,qty,time... |
Definition at line 428 of file cunits.class.php.
References dol_getIdFromCode().
CUnits::scaleOfUnitPow | ( | $id | ) |
Get scale of unit factor.
int | $id | Id of unit in dictionary |
Definition at line 474 of file cunits.class.php.
Referenced by unitConverter().
CUnits::unitConverter | ( | $value, | |
$fk_unit, | |||
$fk_new_unit = 0 ) |
Unit converter.
double | $value | value to convert |
int | $fk_unit | current unit id of value |
int | $fk_new_unit | the id of unit to convert in |
Definition at line 447 of file cunits.class.php.
References price2num(), and scaleOfUnitPow().
CUnits::update | ( | $user = null, | |
$notrigger = 0 ) |
Update object into database.
Definition at line 316 of file cunits.class.php.
References dol_syslog().