Source for file SC_Module.php
Documentation is available at SC_Module.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2008 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once CLASS_PATH .
'SC_Query.php';
require_once CLASS_EX_PATH .
'db_extends/SC_DB_MasterData_Ex.php';
* 各モジュールに固有のデータへのアクセスを担当する.
* $module = new SC_Module('mdl_gmopg', 'GMOPG決済モジュール');
* $arrSubData = $module->getSubData();
* $module->registerSubData($arrData);
* $arrPaymethod = $module->getMasterData('paymethod); // data/cache/mtb_mdl_gmopg_paymethod.php
* $module->log('order error!', $debugValue); // data/logs/mdl_gmopg.log
* @author LOCKON CO.,LTD.
* @version $Id: SC_Module.php 17193 2008-04-01 00:37:39Z adachi $
* TODO モジュールコード周りの改修 命名がばらばらなのを吸収できるように
* TODO テーブル拡張, マスターデータ登録, 初期ファイルコピー処理の追加
return $objQuery->get('dtb_module', 'module_name', 'module_code = ?', $this->getCode());
* @param boolean $toUpper 大文字に変換するかどうか.デフォルトはfalse
function getCode($toUpper =
false) {
return $toUpper ?
strtoupper($moduleCode) :
$moduleCode;
return MODULE_PATH .
$this->getCode() .
'/';
* dtb_moduleのsub_dataを取得する.
function _getSubData($force =
false) {
'dtb_module', 'sub_data', 'module_code = ?', array($moduleCode)
* dtb_moduleのsub_dataを取得する.
function getSubData($key =
null, $force =
false) {
$subData =
$this->_getSubData($force);
$returnData = isset
($subData[$key])
$subData =
array($key =>
$data);
$arrUpdate =
array('sub_data' =>
serialize($subData));
$objQuery->update('dtb_module', $arrUpdate, 'module_code = ?', array($this->getCode()));
* @param unknown_type $key
* @param unknown_type $value
* キャッシュはmtb_mdl_[name]_[***].phpで保存されるが、
* 例えば、mtb_mdl_gmopg_paymethod.phpにアクセスしたい場合は、
* $arrPaymethod = $masterData->getMasterData('paymethod');
$key =
'mtb_' .
$this->getCode() .
"_$key";
return $masterData->getMasterData($key);
* @param mixed $data Dumpしたいデータ.デバッグ用.
function log($msg, $data =
null, $suffix =
'') {
$path =
DATA_PATH .
'logs/' .
$this->getCode() .
"$suffix.log";
Documentation generated on Tue, 28 Apr 2009 18:13:35 +0900 by phpDocumentor 1.4.2