Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions
SKEL_Parameter Class Reference
Collaboration diagram for SKEL_Parameter:
Collaboration graph

Public Member Functions

 __construct ()
 
 save ($p_option, $p_value)
 save the parameter into the database by inserting or updating More...
 

Detailed Description

Definition at line 30 of file class_skel_parameter.php.

Constructor & Destructor Documentation

SKEL_Parameter::__construct ( )

Definition at line 33 of file class_skel_parameter.php.

References $key, and $row.

33  {
34  $this->db=$p_cn;
35  $Res=$p_cn->exec_sql("select * from SKEL.parameter ");
36  for ($i = 0;$i < Database::num_row($Res);$i++)
37  {
38  $row=Database::fetch_array($Res,$i);
39  $key=$row['pr_id'];
40  $elt=$row['pr_value'];
41 
42  // store value here
43  $this->{"$key"}=$elt;
44  }
45 
46  }
for($i=0;$i< Database::num_row($ret);$i++) $row
$key

Member Function Documentation

SKEL_Parameter::save (   $p_option,
  $p_value 
)

save the parameter into the database by inserting or updating

Parameters
$p_attrgive the attribut name

Definition at line 55 of file class_skel_parameter.php.

References $cn.

56  {
57  global $cn;
58  // check if the parameter does exist
59  if ( $this->cn->get_value('select count(*) from SKEL.parameter where pr_id=$1',array($p_option)) != 0 )
60  {
61  $Res=$this->cn->exec_sql("update SKEL.parameter set pr_value=$1 where pr_id=$2",
62  array($p_value,$p_option));
63  }
64  else
65  {
66 
67  $Res=$this->cn->exec_sql("insert into SKEL.parameter (pr_id,pr_value) values( $1,$2)",
68  array($p_option,$p_value));
69 
70  }
71 
72  }
global $cn

The documentation for this class was generated from the following file: