CProductNature
class CProductNature extends CommonDict (View source)
Class of dictionary of nature of product (used by imports)
Properties
| DoliDB | $db | from CommonDict | |
| $error | from CommonDict | ||
| string[] | $errors | from CommonDict | |
| int | $id | from CommonDict | |
| ?int | $entity | from CommonDict | |
| ?string | $code | from CommonDict | |
| ?string | $label | from CommonDict | |
| ?int<0, 1> | $active | from CommonDict | |
| CProductNature[] | $records | ||
| string | $element | ||
| string | $table_element |
Methods
__construct($db)
Constructor
create($user, int $notrigger = 0)
Create object into database
fetch($id, string $code = '')
Load object in memory from database
CProductNature[]|int<-1, -1>
fetchAll(string $sortorder = '', string $sortfield = '', int $limit = 0, int $offset = 0, string|array<string, mixed> $filter = '', string $filtermode = 'AND')
Load list of objects in memory from the database.
update($user = null, int $notrigger = 0)
Update object into database
int
getProductNatureFromCode(int $code, string $mode = 'code')
Get unit from code
Details
__construct($db)
Constructor
@param DoliDB $db Database handler
create($user, int $notrigger = 0)
Create object into database
@param User $user User that create
fetch($id, string $code = '')
Load object in memory from database
@param int $id Id of CUnit object to fetch (rowid)
CProductNature[]|int<-1, -1>
fetchAll(string $sortorder = '', string $sortfield = '', int $limit = 0, int $offset = 0, string|array<string, mixed> $filter = '', string $filtermode = 'AND')
Load list of objects in memory from the database.
update($user = null, int $notrigger = 0)
Update object into database
@param User $user User that modify
delete(User $user, $notrigger = 0)
Delete object in database
int
getProductNatureFromCode(int $code, string $mode = 'code')
Get unit from code