class Ccountry extends CommonDict (View source)

Class to manage dictionary Countries (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 $element
string $table_element
string $code_iso
string $eec
int $favorite
string $numeric_code
array<string, array{type: string, label: string, langfile?: string, enabled: int<0, 2>|string, position: int, notnull?: int, visible: int<-6, 6>|string, alwayseditable?: int<0, 1>|string, noteditable?: int<0, 1>, default?: string, index?: int, foreignkey?: string, searchall?: int<0, 1>, isameasure?: int<0, 1>, css?: string, cssview?: string, csslist?: string, help?: string, showoncombobox?: int<0, 4>|string, 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>, searchmulti?: int<0, 1>}> $fields

Methods

__construct($db)

Constructor

create($user, int $notrigger = 0)

Create object into database

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

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 = '', $code_iso = '')

Load object in memory from database

@param int $id Id object

Parameters

$id
string $code

Code @param string $code_iso Code ISO @return int >0 if OK, 0 if not found, <0 if KO

$code_iso

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