source: branches/version-2_5-dev/data/class/db/SC_DB_DBFactory.php @ 19803

Revision 19803, 4.7 KB checked in by Seasoft, 13 years ago (diff)

#834(パラメータの定数名に「URL」を含むにもかかわらず、パスのみのものがある)

  • 一斉置換前の現状記録のためのコミット

#628(未使用処理・定義などの削除)

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Id Revision Date
  • Property svn:mime-type set to text/x-httpd-php; charset=UTF-8
Line 
1<?php
2/*
3 * This file is part of EC-CUBE
4 *
5 * Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
6 *
7 * http://www.lockon.co.jp/
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
22 */
23
24// {{{ requires
25require_once(CLASS_FILE_PATH . "db/dbfactory/SC_DB_DBFactory_MYSQL.php");
26require_once(CLASS_FILE_PATH . "db/dbfactory/SC_DB_DBFactory_PGSQL.php");
27
28/**
29 * DBに依存した処理を抽象化するファクトリークラス.
30 *
31 * @package DB
32 * @author LOCKON CO.,LTD.
33 * @version $Id:SC_DB_DBFactory.php 15532 2007-08-31 14:39:46Z nanasess $
34 */
35class SC_DB_DBFactory {
36
37    /**
38     * DB_TYPE に応じた DBFactory インスタンスを生成する.
39     *
40     * @return mixed DBFactory インスタンス
41     */
42    function getInstance() {
43        switch (DB_TYPE) {
44        case "mysql":
45            return new SC_DB_DBFactory_MYSQL();
46            break;
47
48        case "pgsql":
49            return new SC_DB_DBFactory_PGSQL();
50            break;
51
52        default:
53            return new SC_DB_DBFactory();
54        }
55    }
56
57    /**
58     * データソース名を取得する.
59     *
60     * 引数 $dsn が空の場合は, DEFAULT_DSN の値を返す.
61     * DEFAULT_DSN が未定義の場合は void となる.
62     * $dsn が空ではない場合は, $dsn の値を返す.
63     *
64     * @param string $dsn データソース名
65     * @return void|string データソース名
66     */
67    function getDSN($dsn = "") {
68        if(empty($dsn)) {
69            if(defined('DEFAULT_DSN')) {
70                $dsn = DEFAULT_DSN;
71            } else {
72                return "";
73            }
74        }
75        return $dsn;
76    }
77
78    /**
79     * DBのバージョンを取得する.
80     *
81     * @param string $dsn データソース名
82     * @return string データベースのバージョン
83     */
84    function sfGetDBVersion($dsn = "") { return null; }
85
86    /**
87     * MySQL 用の SQL 文に変更する.
88     *
89     * @param string $sql SQL 文
90     * @return string MySQL 用に置換した SQL 文
91     */
92    function sfChangeMySQL($sql) { return null; }
93
94    /**
95     * 昨日の売上高・売上件数を算出する SQL を返す.
96     *
97     * @param string $method SUM または COUNT
98     * @return string 昨日の売上高・売上件数を算出する SQL
99     */
100    function getOrderYesterdaySql($method) { return null; }
101
102    /**
103     * 当月の売上高・売上件数を算出する SQL を返す.
104     *
105     * @param string $method SUM または COUNT
106     * @return string 当月の売上高・売上件数を算出する SQL
107     */
108    function getOrderMonthSql($method) { return null; }
109
110    /**
111     * 昨日のレビュー書き込み件数を算出する SQL を返す.
112     *
113     * @return string 昨日のレビュー書き込み件数を算出する SQL
114     */
115    function getReviewYesterdaySql() { return null; }
116
117    /**
118     * メール送信履歴の start_date の検索条件の SQL を返す.
119     *
120     * @return string 検索条件の SQL
121     */
122    function getSendHistoryWhereStartdateSql() { return null; }
123
124    /**
125     * ダウンロード販売の検索条件の SQL を返す.
126     *
127     * @return string 検索条件の SQL
128     */
129    function getDownloadableDaysWhereSql() { return null; }
130
131    /**
132     * 文字列連結を行う.
133     *
134     * @param array $columns 連結を行うカラム名
135     * @return string 連結後の SQL 文
136     */
137    function concatColumn($columns) { return null; }
138
139    /**
140     * テーブルのカラム一覧を取得する.
141     *
142     * @deprecated SC_Query::listTableFields() を使用してください
143     * @param string $table_name テーブル名
144     * @return array テーブルのカラム一覧の配列
145     */
146    function sfGetColumnList($table_name) { return array(); }
147
148    /**
149     * テーブルを検索する.
150     *
151     * 引数に部分一致するテーブル名を配列で返す.
152     *
153     * @deprecated SC_Query::listTables() を使用してください
154     * @param string $expression 検索文字列
155     * @return array テーブル名の配列
156     */
157    function findTableNames($expression = "") { return array(); }
158}
159?>
Note: See TracBrowser for help on using the repository browser.