|
dolibarr
x.y.z
|
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', $unit_type='') | |
| 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.
| CUnits::delete | ( | $user, | |
$notrigger = 0 |
|||
| ) |
Delete object in database.
Definition at line 387 of file cunits.class.php.
| 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 168 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 234 of file cunits.class.php.
| 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 426 of file cunits.class.php.
| CUnits::scaleOfUnitPow | ( | $id | ) |
Get scale of unit factor.
| int | $id | Id of unit in dictionary |
Definition at line 472 of file cunits.class.php.
| 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 445 of file cunits.class.php.
| CUnits::update | ( | $user = null, |
|
$notrigger = 0 |
|||
| ) |
Update object into database.
Definition at line 314 of file cunits.class.php.