OSDN Git Service

初回コミット(v2.6.17.1)
[magic3/magic3.git] / include / addons / contentlib / contentLibDb.php
1 <?php
2 /**
3  * DBクラス
4  *
5  * PHP versions 5
6  *
7  * LICENSE: This source file is licensed under the terms of the GNU General Public License.
8  *
9  * @package    Magic3 Framework
10  * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11  * @copyright  Copyright 2006-2013 Magic3 Project.
12  * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
13  * @version    SVN: $Id: contentLibDb.php 5895 2013-04-01 23:57:46Z fishbone $
14  * @link       http://www.magic3.org
15  */
16 require_once($gEnvManager->getDbPath() . '/baseDb.php');
17
18 class contentLibDb extends BaseDb
19 {
20         /**
21          * コンテンツ項目をコンテンツIDで取得
22          *
23          * @param string  $contentType          コンテンツタイプ
24          * @param string        $contentId              コンテンツID
25          * @param string        $langId                 言語ID
26          * @param array     $row                        レコード
27          * @return bool                                         取得 = true, 取得なし= false
28          */
29         function getContent($contentType, $contentId, $langId, &$row)
30         {
31                 $queryStr  = 'SELECT * FROM content LEFT JOIN _login_user ON cn_create_user_id = lu_id AND lu_deleted = false ';
32                 $queryStr .=   'WHERE cn_deleted = false ';     // 削除されていない
33                 $queryStr .=    'AND cn_type = ? ';
34                 $queryStr .=   'AND cn_id = ? ';
35                 $queryStr .=   'AND cn_language_id = ? ';
36                 $ret = $this->selectRecord($queryStr, array($contentType, $contentId, $langId), $row);
37                 return $ret;
38         }
39         /**
40          * 汎用コンテンツ定義値を取得をすべて取得
41          *
42          * @param string $contentType   コンテンツタイプ
43          * @param array  $rows                  レコード
44          * @return bool                                 1行以上取得 = true, 取得なし= false
45          */
46         function getAllConfig($contentType, &$rows)
47         {
48                 $queryStr  = 'SELECT * FROM content_config ';
49                 $queryStr .=   'WHERE ng_type = ? ';
50                 $queryStr .=   'ORDER BY ng_index';
51                 $retValue = $this->selectRecords($queryStr, array($contentType), $rows);
52                 return $retValue;
53         }
54 }
55 ?>