class CLeadStatus extends CommonDict (View source)

Class of dictionary of opportunity status

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
CLeadStatus> $records
string $element
string $table_element
int $position
float $percent
array<string, array{type: string, label: string, enabled: int<0, 2>|string, position: int, notnull?: int, visible: int<-5, 5>|string, alwayseditable?: int<0, 1>, noteditable?: int<0, 1>, default?: string, index?: int, foreignkey?: string, searchall?: int<0, 1>, isameasure?: int<0, 1>, css?: string, csslist?: string, help?: string, showoncombobox?: int<0, 4>, disabled?: int<0, 1>, arrayofkeyval?: array<int|string, string>, autofocusoncreate?: int<0, 1>, comment?: string, copytoclipboard?: int<1, 2>, validate?: int<0, 1>, showonheader?: int<0, 1>}> $fields

Methods

__construct($db)

Constructor

create($user, int $notrigger = 0)

Create object into database

fetch($id, string $code = '')

Load object in memory from database

array|int
fetchAll(string $sortorder = '', string $sortfield = '', int $limit = 0, int $offset = 0, string $filter = '', string $filtermode = 'AND')

Load list of objects in memory from the database.

update($user = null, int $notrigger = 0)

Update object into database

delete(User $user, $notrigger = 0)

Delete object in database

Details

__construct($db)

Constructor

@param DoliDB $db Database handler

Parameters

$db

create($user, int $notrigger = 0)

Create object into database

@param User $user User that create

Parameters

$user
int $notrigger

0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, Id of created object if OK

fetch($id, string $code = '')

Load object in memory from database

@param int $id Id of CUnit object to fetch (rowid)

Parameters

$id
string $code

Code @return int Return integer <0 if KO, >0 if OK

array|int fetchAll(string $sortorder = '', string $sortfield = '', int $limit = 0, int $offset = 0, string $filter = '', string $filtermode = 'AND')

Load list of objects in memory from the database.

Parameters

string $sortorder

Sort Order

string $sortfield

Sort field

int $limit Limit
int $offset Offset
string $filter

Filter USF

string $filtermode

Filter mode (AND or OR)

Return Value

array|int

int <0 if KO, array of pages if OK

update($user = null, int $notrigger = 0)

Update object into database

@param User $user User that modify

Parameters

$user
int $notrigger

0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, >0 if OK

delete(User $user, $notrigger = 0)

Delete object in database

Parameters

User $user

User that delete @param int $notrigger 0=launch triggers after, 1=disable triggers @return int Return integer <0 if KO, >0 if OK

$notrigger