class Cstate extends CommonDict (View source)

Class to manage dictionary States (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
string deprecated $code_departement
?string $name
$nom

Methods

__construct($db)

Constructor

create($user, int $notrigger = 0)

Create object into database

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

Load object in memory from database

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

Update object into database

delete(User $user, $notrigger = 0)

Delete object in database

string
getNomUrl(int $withpicto = 0, string $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)

Return a link to the object card (with optionally the picto)

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 State ID

Parameters

$id
string $code

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

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

Update object into database

@param User $user User who updates

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

string getNomUrl(int $withpicto = 0, string $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)

Return a link to the object card (with optionally the picto)

Parameters

int $withpicto

Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)

string $option

On what the link point to ('nolink', ...) @param int $notooltip 1=Disable tooltip @param string $morecss Add more css on link @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking

$notooltip
$morecss
$save_lastsearch_value

Return Value

string

String with URL