Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions | Static Public Member Functions
Rapav_Declaration_Detail Class Reference
Inheritance diagram for Rapav_Declaration_Detail:
Inheritance graph
Collaboration diagram for Rapav_Declaration_Detail:
Collaboration graph

Public Member Functions

 from_array ($p_array)
 the p_array contains a row from formulaire_param_detail it will be copied into this->form. More...
 

Static Public Member Functions

static factory ($p_array)
 create an object RAPAV_dd_Formula, RAPAV_dd_Account_Tva or Rapav_dd_compute following the idx type_detail More...
 

Detailed Description

Definition at line 834 of file class_rapav_declaration.php.

Member Function Documentation

static Rapav_Declaration_Detail::factory (   $p_array)
static

create an object RAPAV_dd_Formula, RAPAV_dd_Account_Tva or Rapav_dd_compute following the idx type_detail

Parameters
type$p_array
Returns
object RAPAV_dd_Formula, RAPAV_dd_Account_Tva or Rapav_dd_compute
Exceptions
ifthe type is not known

Definition at line 843 of file class_rapav_declaration.php.

References $ret.

Referenced by Rapav_Declaration_Param\compute(), and Rapav_Declaration_Param\compute_child().

844  {
845  switch ($p_array['type_detail'])
846  {
847  case '1':
848  $ret = new Rapav_dd_Formula();
849  break;
850  case '2':
851  $ret = new Rapav_dd_Account_Tva();
852  break;
853  case '3':
854  $ret = new Rapav_dd_Compute();
855  break;
856  case '4':
857  $ret = new Rapav_dd_Account();
858  break;
859  case '5':
860  $ret = new Rapav_dd_Reconcile();
861  break;
862  case '6' :
863  // For each child we have a Rapav_dd_Account
864  $ret = new Rapav_dd_Account();
865  break;
866  default:
867  throw new Exception("Type inconnu");
868  }
869 
870  $ret->from_array($p_array);
871  $ret->ddr_amount = 0; // cannot be null
872  return $ret;
873  }
$ret
handle the param_detail type Compute
handle the param_detail type Account The type_sum_account gives the type of total ...
handle the param_detail type Account The type_sum_account gives the type of total ...
handle the param_detail type Account_Tva The t_id gives the type of total
Rapav_Declaration_Detail::from_array (   $p_array)

the p_array contains a row from formulaire_param_detail it will be copied into this->form.

Parameters
type$p_arraymatch formulaire_param_detail table structure

Definition at line 880 of file class_rapav_declaration.php.

881  {
882  $this->form = new Formulaire_Param_Detail();
883  $attribute = explode(',', 'fp_id,p_id,tmp_val,tva_id,fp_formula,fp_signed,jrn_def_type,tt_id,type_detail,with_tmp_val,type_sum_account,operation_pcm_val,jrn_def_id,date_paid');
884  foreach ($attribute as $e)
885  {
886  $this->form->$e = $p_array[$e];
887  }
888  }

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