41 $this->
table=
"public.v_currency_last_value";
42 $this->primary_key=
"currency_id";
47 "currency_id"=>
"currency_id"
48 ,
"cr_name"=>
"cr_name"
49 ,
"cr_code_iso"=>
"cr_code_iso"
50 ,
"currency_history_id"=>
"currency_history_id"
51 ,
"ch_value"=>
"ch_value"
52 ,
"str_from"=>
"str_from"
58 "currency_id"=>
"numeric"
60 ,
"cr_code_iso"=>
"text"
61 ,
"currency_history_id"=>
"numeric"
62 ,
"ch_value"=>
"numeric"
71 $this->date_format=
"DD.MM.YYYY";
72 parent::__construct($p_cn,
$p_id);
77 $count=$this->
cn->get_value(
"select count(*) from $this->table ".$p_where,
$p_array);
81 public function delete()
84 $is_used = $this->
cn->get_value(
"select count(*) from jrn where currency_id=$1",[$this->currency_id]);
87 if ( $is_used <> 0 ) {
throw new Exception (_(
"Devise utilisée")); }
90 if ( $this->currency_id == -1 ) {
91 throw new Exception(_(
"EUR ne peut pas être effacé"));
93 $this->
cn->exec_sql(
"delete from currency_history where currency_id=$1",[$this->currency_id]);
94 $this->
cn->exec_sql(
"delete from currency where id=$1",[$this->currency_id]);
101 $count=$this->
cn->get_value(
"select count(*) from ".$this->
table.
" where ".$this->primary_key.
"=$1",
115 foreach ($this->
name as $key)
117 switch ($this->
type[$key])
120 $sql.=
$sep.
'to_char('.$key.
",'".$this->date_format.
"') as ".$key;
128 $sql.=
" from ".$this->table;
130 $sql.=
" where ".$this->primary_key.
" = $1";
133 if ($this->
cn->count()==0)
148 $sql=
"select * from ".$this->table.
" $cond";
this an abstract class , all the SQL class, like noalyss_sql (table), Acc_Plan_SQL (based on a SQL no...
$primary_key
Array of logical and real name.
contains the class for connecting to Noalyss
class_currency_history_sql.php
exist()
Count the number of record with the id ,.
count($p_where="", $p_array=null)
load()
Load the current row return false if not found.
seek($cond='', $p_array=null)
retrieve array of object thanks a condition
__construct(Database $p_cn, $p_id=-1)