Source for file SC_Module.php
Documentation is available at SC_Module.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 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_REALDIR . 'SC_Query.php';
require_once CLASS_EX_REALDIR . '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 20764 2011-03-22 06:26:40Z nanasess $
* TODO モジュールコード周りの改修 命名がばらばらなのを吸収できるように
* TODO テーブル拡張, マスターデータ登録, 初期ファイルコピー処理の追加
$objQuery = new SC_Query_Ex();
return $objQuery->get('module_name', 'dtb_module', 'module_code = ?', $this->getCode());
* @param boolean $toUpper 大文字に変換するかどうか.デフォルトはfalse
function getCode($toUpper = false) {
return $toUpper ? strtoupper($moduleCode) : $moduleCode;
return MODULE_REALDIR . $this->getCode() . '/';
* dtb_moduleのsub_dataを取得する.
function _getSubData($force = false) {
$objQuery = new SC_Query_Ex();
'sub_data', 'dtb_module', '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 = new SC_Query_Ex();
$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";
$masterData = new SC_DB_MasterData_Ex;
return $masterData->getMasterData($key);
* @param mixed $data Dumpしたいデータ.デバッグ用.
function log($msg, $data = null, $suffix = '') {
$path = DATA_REALDIR . 'logs/' . $this->getCode() . "$suffix.log";
GC_Utils_Ex::gfPrintLog($msg, $path);
GC_Utils_Ex::gfPrintLog(print_r($data, true), $path);
Documentation generated on Fri, 24 Feb 2012 14:02:51 +0900 by Seasoft
|