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

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

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.
 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 class_acc_report_row.php.


Constructor & Destructor Documentation

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

Definition at line 37 of file class_acc_report_row.php.

References set_parameter().

    {
        $this->set_parameter("id",0);

        $this->set_parameter("name",$p_name);
        $this->set_parameter("formula",$p_formula);
    }

Member Function Documentation

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 class_acc_report_row.php.

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

    {
        extract ($p_array);
        $ret=array();
        $ix=0;
        $found=0;
        foreach ( $p_array as $r)
        {

            if ( isset(${'form'.$ix}) && isset ( ${'text'.$ix} ))
            {
                $obj=new Acc_Report_Row( ${'text'.$ix},${'form'.$ix});

                if ( isset(${'pos'.$ix}) &&  isNumber(${'pos'.$ix})==1 )
                    $obj->set_parameter("position",${'pos'.$ix});
                else
                {
                    $obj->set_parameter("position",$found);
                    $found++;
                }

                $obj->fo_id=0;
                $obj->fo_fr_id=$this->fo_fr_id;
                $obj->db=$this->db;

                $ret[]=clone $obj;
            }
            $ix++;

        }
        return $ret;
    }

Definition at line 66 of file class_acc_report_row.php.

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

Definition at line 44 of file class_acc_report_row.php.

References $idx, and exit.

    {
        if ( array_key_exists($p_string,self::$variable) )
        {
            $idx=self::$variable[$p_string];
            return $this->$idx;
        }
        else
            exit (__FILE__.":".__LINE__.'Erreur attribut inexistant');
    }
Acc_Report_Row::set_parameter ( p_string,
p_value 
)

Definition at line 54 of file class_acc_report_row.php.

References $idx, and exit.

Referenced by __construct().

    {
        if ( array_key_exists($p_string,self::$variable) )
        {
            $idx=self::$variable[$p_string];
            $this->$idx=$p_value;
        }
        else
            exit (__FILE__.":".__LINE__."$p_string ".'Erreur attribut inexistant');


    }
static Acc_Report_Row::test_me ( ) [static]

Definition at line 108 of file class_acc_report_row.php.

References $a, $array, $b, $cn, echo, and id.

    {
        $cn=new Database(dossier::id());
        $a=new Acc_Report_Row();
        $array=array("text0"=>"test1",
                     "form0"=>"7%",
                     "text1"=>"test2",
                     "form1"=>"6%"
                    );
        $a->db=$cn;
        $b=$a->from_array($array);
        print_r($b);
        echo $a->get_info();
    }

Field Documentation

Acc_Report_Row::$variable [static, private]
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 class_acc_report_row.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations