Manage the table importbank.temp_bank.
More...
Manage the table importbank.temp_bank.
Definition at line 36 of file class_temp_bank_sql.php.
Temp_Bank_sql::__construct |
( |
& |
$p_cn, |
|
|
|
$p_id = -1 |
|
) |
| |
Temp_Bank_sql::delete |
( |
| ) |
|
Temp_Bank_sql::get_info |
( |
| ) |
|
Temp_Bank_sql::get_object |
( |
|
$p_ret, |
|
|
|
$idx |
|
) |
| |
get_seek return the next object, the return of the query must have all the column of the object
- Parameters
-
$p_ret | is the return value of an exec_sql |
$idx | is the index |
- See Also
- seek
- Returns
- object
Definition at line 151 of file class_temp_bank_sql.php.
References $array.
155 $array=Database::fetch_array($p_ret,$idx);
156 foreach (
$array as $idx=>$value)
Manage the table importbank.temp_bank.
if(isset($_POST['remove'])) $array
Temp_Bank_sql::get_parameter |
( |
|
$p_string | ) |
|
Definition at line 71 of file class_temp_bank_sql.php.
73 if ( array_key_exists($p_string,$this->variable) )
75 $idx=$this->variable[$p_string];
79 throw new Exception (__FILE__.
":".__LINE__.$p_string.
'Erreur attribut inexistant');
Temp_Bank_sql::insert |
( |
| ) |
|
Definition at line 164 of file class_temp_bank_sql.php.
References $sql, and verify().
Referenced by save().
166 if ( $this->
verify() != 0 )
return;
170 $sql=
"insert into importbank.temp_bank(tp_date
182 ) values (to_date($1,'DD.MM.YYYY')
197 $this->
id=$this->cn->get_value(
199 array( $this->tp_date
203 ,$this->ref_operation
217 $sql=
"insert into importbank.temp_bank(tp_date
227 ,id) values (to_date($1,'DD.MM.YYYY')
242 $this->
id=$this->cn->get_value(
244 array( $this->tp_date
248 ,$this->ref_operation
load a object
- Returns
- 0 on success -1 the object is not found
Definition at line 304 of file class_temp_bank_sql.php.
References $key, $res, and $sql.
Referenced by __construct().
307 $sql=
"select to_char(tp_date,'DD.MM.YYYY') as tp_date
319 from importbank.temp_bank where id=$1";
321 $res=$this->cn->get_array(
326 if ( count(
$res) == 0 )
329 foreach ($this->variable as
$key=>$value) $this->
$key=
'';
333 foreach (
$res[0] as $idx=>$value)
Temp_Bank_sql::seek |
( |
|
$cond = '' , |
|
|
|
$p_array = null |
|
) |
| |
retrieve array of object thanks a condition
- Parameters
-
$cond | condition (where clause) (optional by default all the rows are fetched) you can use this parameter for the order or subselect |
$p_array | array for the SQL stmt |
- See Also
- Database::exec_sql get_object Database::num_row
- Returns
- the return value of exec_sql
Definition at line 136 of file class_temp_bank_sql.php.
References $ret, and $sql.
138 $sql=
"select * from importbank.temp_bank $cond";
140 $ret= $this->cn->exec_sql(
$sql,$p_array);
Temp_Bank_sql::set_parameter |
( |
|
$p_string, |
|
|
|
$p_value |
|
) |
| |
Definition at line 81 of file class_temp_bank_sql.php.
83 if ( array_key_exists($p_string,$this->variable) )
85 $idx=$this->variable[$p_string];
89 throw new Exception (__FILE__.
":".__LINE__.$p_string.
'Erreur attribut inexistant');
static Temp_Bank_sql::test_me |
( |
| ) |
|
|
static |
Unit test for the class.
Definition at line 348 of file class_temp_bank_sql.php.
References $cn, and $obj.
350 $cn=
new Database(25);
352 echo h2info(
'Test object vide');
356 echo h2info(
'Test object NON vide');
357 $obj->set_parameter(
'j_id',3);
361 echo h2info(
'Update');
362 $obj->set_parameter(
'j_qcode',
'NOUVEAU CODE');
367 echo h2info(
'Insert');
368 $obj->set_parameter(
'j_id',0);
373 echo h2info(
'Delete');
375 echo ((
$obj->load()==0)?
'Trouve':
'non trouve');
Manage the table importbank.temp_bank.
Temp_Bank_sql::update |
( |
| ) |
|
Temp_Bank_sql::verify |
( |
| ) |
|
Definition at line 95 of file class_temp_bank_sql.php.
Referenced by insert(), and update().
99 if ( trim($this->tp_date) ==
'') $this->tp_date=null;
100 if ( trim($this->jrn_def_id) ==
'') $this->jrn_def_id=null;
101 if ( $this->jrn_def_id!== null && settype($this->jrn_def_id,
'float') ==
false )
102 throw new Exception(
'DATATYPE jrn_def_id $this->jrn_def_id non numerique');
103 if ( trim($this->libelle) ==
'') $this->libelle=null;
104 if ( trim($this->amount) ==
'') $this->amount=null;
105 if ( $this->amount!== null && settype($this->amount,
'float') ==
false )
106 throw new Exception(
'DATATYPE amount $this->amount non numerique');
107 if ( trim($this->ref_operation) ==
'') $this->ref_operation=null;
108 if ( trim($this->status) ==
'') $this->status=null;
109 if ( trim($this->import_id) ==
'') $this->import_id=null;
110 if ( $this->import_id!== null && settype($this->import_id,
'float') ==
false )
111 throw new Exception(
'DATATYPE import_id $this->import_id non numerique');
112 if ( trim($this->tp_third) ==
'') $this->tp_third=null;
113 if ( trim($this->tp_extra) ==
'') $this->tp_extra=null;
114 if ( trim($this->f_id) ==
'') $this->f_id=null;
115 if ( $this->f_id!== null && settype($this->f_id,
'float') ==
false )
116 throw new Exception(
'DATATYPE f_id $this->f_id non numerique');
Initial value:=array("id"=>"id","tp_date"=>"tp_date"
,"jrn_def_id"=>"jrn_def_id"
,"libelle"=>"libelle"
,"amount"=>"amount"
,"ref_operation"=>"ref_operation"
,"status"=>"status"
,"import_id"=>"import_id"
,"tp_third"=>"tp_third"
,"tp_extra"=>"tp_extra"
,"f_id"=>"f_id"
,"tp_rec"=>"tp_rec"
,"tp_error_msg"=>"tp_error_msg"
)
Definition at line 40 of file class_temp_bank_sql.php.
The documentation for this class was generated from the following file: