|
dolibarr
13.0.2
|
Class of dictionary type of thirdparty (used by imports) More...
Public Member Functions | |
| __construct ($db) | |
| Constructor. More... | |
| create ($user, $notrigger=0) | |
| Create object into database. More... | |
| fetch ($id, $code= '', $short_label= '', $unit_type= '') | |
| 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... | |
| getUnitFromCode ($code, $mode= 'code') | |
| Get unit from code. More... | |
| unitConverter ($value, $fk_unit, $fk_new_unit=0) | |
| Unit converter. More... | |
| scaleOfUnitPow ($id) | |
| get scale of unit factor More... | |
Class of dictionary type of thirdparty (used by imports)
Definition at line 28 of file cunits.class.php.
| CUnits::__construct | ( | $db | ) |
Constructor.
| DoliDb | $db | Database handler |
Definition at line 69 of file cunits.class.php.
References db.
| CUnits::create | ( | $user, | |
$notrigger = 0 |
|||
| ) |
Create object into database.
Definition at line 82 of file cunits.class.php.
References $resql, code, db, and dol_syslog().
| CUnits::delete | ( | $user, | |
$notrigger = 0 |
|||
| ) |
Delete object in database.
Definition at line 348 of file cunits.class.php.
References $resql, db, and 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 154 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 214 of file cunits.class.php.
References $resql, db, and dol_syslog().
| CUnits::getUnitFromCode | ( | $code, | |
$mode = 'code' |
|||
| ) |
Get unit from code.
| string | $code | code of unit |
| string | $mode | 0= id , short_label=Use short label as value, code=use code |
Definition at line 385 of file cunits.class.php.
References db, and dol_getIdFromCode().
| CUnits::scaleOfUnitPow | ( | $id | ) |
get scale of unit factor
| int | $id | id of unit in dictionary |
Definition at line 431 of file cunits.class.php.
References db.
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 404 of file cunits.class.php.
References price2num(), and scaleOfUnitPow().
| CUnits::update | ( | $user = null, |
|
$notrigger = 0 |
|||
| ) |
Update object into database.
Definition at line 292 of file cunits.class.php.
References $resql, code, db, and dol_syslog().