noalyss  Version-9
Public Member Functions | Static Public Member Functions | Static Private Attributes
Acc_Report_Row Class Reference

manipulate the form_def's child table (form) More...

+ Collaboration diagram for Acc_Report_Row:

Public Member Functions

 __construct ($p_name=null, $p_formula=null)
 
 from_array ($p_array)
 Convert an array into an array of row_rapport object the fo_id is 0, position = 0, the fo_frd_id (form_id) is the one of the current object, the db is also the current one. More...
 
 get_info ()
 
 get_parameter ($p_string)
 
 set_parameter ($p_string, $p_value)
 

Static Public Member Functions

static test_me ()
 

Static Private Attributes

static $variable
 

Detailed Description

manipulate the form_def's child table (form)

Definition at line 27 of file acc_report_row.class.php.

Constructor & Destructor Documentation

◆ __construct()

Acc_Report_Row::__construct (   $p_name = null,
  $p_formula = null 
)

Definition at line 37 of file acc_report_row.class.php.

38  {
39  $this->set_parameter("id",0);
40 
41  $this->set_parameter("name",$p_name);
42  $this->set_parameter("formula",$p_formula);
43  }

References set_parameter().

+ Here is the call graph for this function:

Member Function Documentation

◆ from_array()

Acc_Report_Row::from_array (   $p_array)

Convert an array into an array of row_rapport object the fo_id is 0, position = 0, the fo_frd_id (form_id) is the one of the current object, the db is also the current one.

Parameters
$p_arraycontains the value
Returns
an array of Acc_Report_Row object

Definition at line 76 of file acc_report_row.class.php.

77  {
78  extract ($p_array, EXTR_SKIP);
79  $ret=array();
80  $ix=0;
81  $found=0;
82  foreach ( $p_array as $r)
83  {
84 
85  if ( isset(${'form'.$ix}) && isset ( ${'text'.$ix} ))
86  {
87  $obj=new Acc_Report_Row( ${'text'.$ix},${'form'.$ix});
88 
89  if ( isset(${'pos'.$ix}) && isNumber(${'pos'.$ix})==1 )
90  $obj->set_parameter("position",${'pos'.$ix});
91  else
92  {
93  $obj->set_parameter("position",$found);
94  $found++;
95  }
96 
97  $obj->fo_id=0;
98  $obj->fo_fr_id=$this->fo_fr_id;
99  $obj->db=$this->db;
100 
101  $ret[]=clone $obj;
102  }
103  $ix++;
104 
105  }
106  return $ret;
107  }

References $ix, $obj, $p_array, $r, $ret, and isNumber().

+ Here is the call graph for this function:

◆ get_info()

Acc_Report_Row::get_info ( )

Definition at line 66 of file acc_report_row.class.php.

67  {
68  return var_export(self::$variable,true);
69  }

◆ get_parameter()

Acc_Report_Row::get_parameter (   $p_string)

Definition at line 44 of file acc_report_row.class.php.

45  {
46  if ( array_key_exists($p_string,self::$variable) )
47  {
48  $idx=self::$variable[$p_string];
49  return $this->$idx;
50  }
51  else
52  throw new Exception("Attribut inexistant $p_string");
53  }

References $idx.

◆ set_parameter()

Acc_Report_Row::set_parameter (   $p_string,
  $p_value 
)

Definition at line 54 of file acc_report_row.class.php.

55  {
56  if ( array_key_exists($p_string,self::$variable) )
57  {
58  $idx=self::$variable[$p_string];
59  $this->$idx=$p_value;
60  }
61  else
62  throw new Exception("Attribut inexistant $p_string");
63 
64 
65  }

References $idx.

Referenced by __construct().

◆ test_me()

static Acc_Report_Row::test_me ( )
static

Definition at line 108 of file acc_report_row.class.php.

109  {
111  $a=new Acc_Report_Row();
112  $array=array("text0"=>"test1",
113  "form0"=>"7%",
114  "text1"=>"test2",
115  "form1"=>"6%"
116  );
117  $a->db=$cn;
118  $b=$a->from_array($array);
119  print_r($b);
120  echo $a->get_info();
121  }

References $a, $array, $b, $cn, and Dossier\connect().

+ Here is the call graph for this function:

Field Documentation

◆ $variable

Acc_Report_Row::$variable
staticprivate
Initial value:
=array(
"name"=>"fo_label",
"formula"=>"fo_formula",
"id"=>"fo_id",
"position"=>"fo_pos",
"form_id"=>"fo_fr_id",
"database"=>"db"
)

Definition at line 29 of file acc_report_row.class.php.


The documentation for this class was generated from the following file:
$ret
$ret
Definition: ajax_display_letter.php:52
$b
$b
Definition: export_balance_pdf.php:109
$ix
$ix
Definition: dashboard.php:161
Dossier\connect
static connect()
Definition: dossier.class.php:284
$array
$array
Definition: ajax_add_concerned_card.php:118
Acc_Report_Row\set_parameter
set_parameter($p_string, $p_value)
Definition: acc_report_row.class.php:54
Acc_Report_Row
manipulate the form_def's child table (form)
Definition: acc_report_row.class.php:27
$a
$a
Definition: ajax_add_concerned_card.php:111
isNumber
isNumber($p_int)
Definition: ac_common.php:221
$obj
$obj
Definition: ajax_accounting.php:45
$r
$r
Definition: ajax_add_concerned_card.php:56
$idx
$idx
Definition: ajax_bookmark.php:79
$cn
$cn
Definition: ajax_anc_accounting.php:31
$p_array
$p_array
Definition: ajax_view_mod_stock.php:34