Changeset 13742 for branches/dev


Ignore:
Timestamp:
2007/05/30 00:14:16 (19 years ago)
Author:
adati
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev/html/test/adachi/SC_Param.php

    r13567 r13742  
    44 */ 
    55class SC_Param { 
    6     var $_name; 
     6    var $_keyname; 
     7    var $_dispname 
    78    var $_value; 
    89    var $_group; 
    910    var $_parent; 
    1011    var $_file; 
    11     var $_convertType; 
    12     var $_validateType; 
    13     var $_error; 
     12    var $_convert; 
     13    var $_validate; 
     14    var $_javascript; 
    1415     
    1516    function SC_Param($arrParamInfo){ 
    16         $this->init($arrParamInfo); 
     17        $this->_init($arrParamInfo); 
    1718    } 
    1819     
    19     function init($arrParamInfo){ 
    20         $arrProperties = array( 
    21             'name', 'value', 'group', 'child', 'parent', 
    22             'file', 'convertType', 'validateType' 
    23         ); 
     20    function _init($arrParamInfo){ 
     21        $arrProperties = array_keys(get_object_vars($this)); 
    2422         
    2523        foreach ($arrProperties as $property) { 
    26             $this->$property 
    27                 = isset($arrParamInfo[$property]) ? $arrParamInfo[$property] : null; 
     24            $this->$property = isset($arrParamInfo[$property]) 
     25                ? $arrParamInfo[preg_replace('/^_/', '', $property)] 
     26                : null; 
    2827        } 
    2928    } 
    3029     
    31     function getEscapeValue(){ 
    32         return htmlspecialchars($this->_value, ENT_QUOTES, CHAR_CODE)); 
     30    function getEscapeValue($CHAR_CODE = CHAR_CODE){ 
     31        return htmlspecialchars($this->_value, ENT_QUOTES, $CHAR_CODE); 
    3332    } 
    3433     
     
    3837     
    3938    function convert(){ 
    40         $this->_value = mb_convert_kana($this->_value, $this->$_convertType); 
     39        $this->_value = mb_convert_kana($this->_value, $this->$_convert); 
    4140    } 
    4241     
    43     function getName(){ 
    44         return $this->_Name; 
     42    function getKeyName(){ 
     43        return $this->_keyname; 
     44    } 
     45     
     46    function getDispName(){ 
     47        return $this->_dispname; 
    4548    } 
    4649     
     
    4952    } 
    5053     
    51     } 
    5254} 
    5355?> 
Note: See TracChangeset for help on using the changeset viewer.