|
dolibarr 20.0.5
|
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, $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. | |
| 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 32 of file cunits.class.php.
| CUnits::__construct | ( | $db | ) |
| CUnits::create | ( | $user, | |
| $notrigger = 0 ) |
Create object into database.
Definition at line 70 of file cunits.class.php.
References dol_syslog().
| CUnits::delete | ( | $user, | |
| $notrigger = 0 ) |
Delete object in database.
Definition at line 385 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 155 of file cunits.class.php.
| CUnits::fetchAll | ( | $sortorder = '', | |
| $sortfield = '', | |||
| $limit = 0, | |||
| $offset = 0, | |||
| $filter = '', | |||
| $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 |
| string | array | $filter | Filter USF |
| string | $filtermode | Filter mode (AND or OR) |
Definition at line 219 of file cunits.class.php.
References dol_syslog(), and forgeSQLFromUniversalSearchCriteria().
| 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 423 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 465 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 438 of file cunits.class.php.
References price2num(), and scaleOfUnitPow().
| CUnits::update | ( | $user = null, | |
| $notrigger = 0 ) |
Update object into database.
Definition at line 313 of file cunits.class.php.
References dol_syslog().