25require_once DOL_DOCUMENT_ROOT.
'/core/class/commondict.class.php';
47 public $description =
'';
74 public function fetch($id, $code =
'')
80 $sql .=
" i.libelle as description";
81 $sql .=
" FROM ".$this->db->prefix().
"c_incoterms as i";
83 $sql .=
" WHERE i.rowid = ".((int) $id);
85 $sql .=
" WHERE i.code = '".$this->db->escape($code).
"'";
88 dol_syslog(get_class($this).
"::fetch", LOG_DEBUG);
89 $resql = $this->db->query($sql);
91 if ($this->db->num_rows($resql)) {
92 $obj = $this->db->fetch_object($resql);
94 $this->
id = $obj->rowid;
95 $this->code = $obj->code;
96 $this->label = $obj->label;
97 $this->libelle = $obj->description;
99 $this->
active = $obj->active;
101 $this->db->free($resql);
105 $this->error =
"Error ".$this->db->lasterror();
Class to manage dictionary Incoterms (used by imports)
__construct($db)
Constructor.
fetch($id, $code='')
Load object in memory from database.
Parent class of all other dictionary classes.
print $script_file $mode $langs defaultlang(is_numeric($duration_value) ? " delay=". $duration_value :"").(is_numeric($duration_value2) ? " after cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.