Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions
Copro_Parameter Class Reference
Collaboration diagram for Copro_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 29 of file class_copro_parameter.php.

Constructor & Destructor Documentation

Copro_Parameter::__construct ( )

Definition at line 32 of file class_copro_parameter.php.

References $cn, $key, and $row.

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

Member Function Documentation

Copro_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 53 of file class_copro_parameter.php.

References $cn.

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

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