Changeset 15169


Ignore:
Timestamp:
2007/08/03 16:31:54 (17 years ago)
Author:
nanasess
Message:

定数を出力する場合にコメントも出力するように変更

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/db/SC_DB_MasterData.php

    r15163 r15169  
    205205        $data = "<?php\n"; 
    206206        if ($isDefine) { 
    207             $data .= $this->getMasterDataAsDefine($masterData); 
     207            $data .= $this->getMasterDataAsDefine($masterData, 
     208                    $this->getDbMasterData("mtb_constants", array("id", "remarks", "rank"))); 
    208209        } else { 
    209210            $data .= $this->getMasterDataAsString($name, $masterData); 
     
    268269     */ 
    269270    function getDefaultColumnName($columns = array()) { 
     271 
    270272        if (!empty($columns)) { 
    271273            return $columns; 
    272         } 
    273         return $this->columns; 
     274        } else { 
     275            return $this->columns; 
     276        } 
    274277    } 
    275278 
     
    301304     * @access private 
    302305     * @param array $masterData マスタデータの配列 
     306     * @param array $comments コメントの配列 
    303307     * @return string 定数定義の文字列 
    304308     */ 
    305     function getMasterDataAsDefine($masterData) { 
     309    function getMasterDataAsDefine($masterData, $comments = array()) { 
    306310        $data = ""; 
    307311        foreach ($masterData as $key => $val) { 
     312            if (isset($comments[$key])) { 
     313                $data .= "/** " . $comments[$key] . " */\n"; 
     314            } 
    308315            $data .= "define('" . $key . "', " . $val . ");\n"; 
    309316        } 
Note: See TracChangeset for help on using the changeset viewer.