class Cregion extends CommonDict (View source)

Class to manage dictionary Regions

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
?int $code_region
?int $fk_pays
?string $name
?string $cheflieu

Methods

__construct($db)

Constructor

create($user, int $notrigger = 0)

Create object into database

fetch($id, int $code_region = 0, $fk_pays = 0)

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, int $code_region = 0, $fk_pays = 0)

Load object in memory from database

@param int $id Id object

Parameters

$id
int $code_region

Code @param int $fk_pays Country Id @return int >0 if OK, 0 if not found, <0 if KO

$fk_pays

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

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