noalyss
Version-6.7.2
|
manage the table forecast_item contains the items, the item are part of category of forecast_cat, which are part of Forecast More...
Public Member Functions | |
__construct ($p_init, $p_id=0) | |
constructor | |
delete () | |
get_info () | |
get_parameter ($p_string) | |
insert () | |
load () | |
save () | |
set_parameter ($p_string, $p_value) | |
update () | |
verify () | |
Static Public Member Functions | |
static | test_me () |
unit test | |
Private Attributes | |
$cn | |
Static Private Attributes | |
static | $variable |
manage the table forecast_item contains the items, the item are part of category of forecast_cat, which are part of Forecast
Definition at line 34 of file class_forecast_item.php.
Forecast_Item::__construct | ( | $ | p_init, |
$ | p_id = 0 |
||
) |
constructor
$p_init | Database object |
Definition at line 44 of file class_forecast_item.php.
References cn.
{ $this->cn=$p_init; $this->fi_id=$p_id; }
Definition at line 71 of file class_forecast_item.php.
{ return var_export(self::$variable,true); }
Forecast_Item::get_parameter | ( | $ | p_string | ) |
Definition at line 91 of file class_forecast_item.php.
References $res, $sql, cn, Database\fetch_result(), and verify().
Referenced by save().
{ if ( $this->verify() != 0 ) return; $sql="INSERT INTO forecast_item( fi_text, fi_account, fi_card, fi_order, fc_id, fi_amount, fi_debit,fi_pid) VALUES ($1, $2, $3, $4, $5, $6, $7,$8) returning fi_id;"; $res=$this->cn->exec_sql( $sql, array($this->fi_text,$this->fi_account,$this->fi_card,$this->fi_order,$this->fc_id,$this->fi_amount,$this->fi_debit,$this->fi_pid) ); $this->fi_id=Database::fetch_result($res,0,0); }
Definition at line 128 of file class_forecast_item.php.
References $idx, $res, $row, $sql, $value, cn, Database\fetch_array(), and Database\num_row().
{ $sql="SELECT fi_id, fi_text, fi_account, fi_card, fi_order, fc_id, fi_amount, fi_debit,fi_pid FROM forecast_item where fi_id=$1"; $res=$this->cn->exec_sql( $sql, array($this->fi_id) ); if ( Database::num_row($res) == 0 ) return; $row=Database::fetch_array($res,0); foreach ($row as $idx=>$value) { $this->$idx=$value; } }
Definition at line 82 of file class_forecast_item.php.
References get_parameter(), insert(), and update().
{ /* please adapt */ if ( $this->get_parameter("id") == 0 ) $this->insert(); else $this->update(); }
Forecast_Item::set_parameter | ( | $ | p_string, |
$ | p_value | ||
) |
static Forecast_Item::test_me | ( | ) | [static] |
Definition at line 106 of file class_forecast_item.php.
References $res, $sql, cn, and verify().
Referenced by save().
{ if ( $this->verify() != 0 ) return; $sql="UPDATE forecast_item SET fi_text=$1, fi_account=$2, fi_card=$3, fi_order=$4, fc_id=$5, fi_amount=$6, fi_debit=$7,fi_pid=$8 WHERE fi_id=$9;"; $res=$this->cn->exec_sql($sql, array($this->fi_text, $this->fi_account, $this->fi_card, $this->fi_order, $this->fc_id, $this->fi_amount, $this->fi_debit, $this->fi_pid, $this->fi_id) ); }
Definition at line 75 of file class_forecast_item.php.
Referenced by insert(), and update().
{ $this->fi_account= str_replace(" ", "", $this->fi_account); // Verify that the elt we want to add is correct // the f_name must be unique (case insensitive) return 0; }
Forecast_Item::$cn [private] |
Definition at line 39 of file class_forecast_item.php.
Forecast_Item::$variable [static, private] |
array ("id"=>"fi_id","text"=>"fi_text","account"=>"fi_account", "card"=>"fi_card","order"=>"fi_order","cat_id"=>"fc_id","amount"=>"fi_amount","debit"=>"fi_debit","periode"=>"fi_pid")
Definition at line 37 of file class_forecast_item.php.