Sample4Model   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 4
Bugs 3 Features 2
Metric Value
wmc 3
c 4
b 3
f 2
lcom 1
cbo 2
dl 0
loc 56
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getAll() 0 4 1
A begin() 0 9 1
A end() 0 5 1
1
<?php
2
/**
3
 * Sample4Model
4
 *
5
 * Sample4用のModelを実現するためのクラス
6
 *
7
 * @package           risoluto
8
 * @author            Risoluto Developers
9
 * @license           http://opensource.org/licenses/bsd-license.php new BSD license
10
 * @copyright     (C) 2008-2015 Risoluto Developers / All Rights Reserved.
11
 */
12
13
//------------------------------------------------------//
14
// 名前空間の定義
15
//------------------------------------------------------//
16
namespace RisolutoApps\Sample;
17
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21
class Sample4Model extends \Risoluto\RisolutoModelBase
22
{
23
    /**
24
     * begin()
25
     *
26
     * モデルの初期処理を行う
27
     *
28
     * @access    public
29
     *
30
     * @param     void
31
     *
32
     * @return    処理結果(true: 成功 / false: 失敗)
0 ignored issues
show
Documentation introduced by Yuta Hayakawa
The doc-type 処理結果(true: could not be parsed: Unknown type name "処理結果(true:" at position 0. (view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
33
     */
34
    public function begin()
35
    {
36
        // コンフィグから接続情報を取得する
37
        $db_conf = new \Risoluto\Conf;
38
        $db_conf->parse( RISOLUTO_CONF . 'risoluto_db.ini' );
39
40
        // DBへ接続する
41
        return $this->db->connect( $db_conf->getIni( 'DB' ) );
42
    }
43
44
    /**
45
     * getAll()
46
     *
47
     * テーブル中の全データを取得する
48
     *
49
     * @access    public
50
     *
51
     * @param     void
52
     *
53
     * @return    string テーブル中の全データ
54
     */
55
    public function getAll()
56
    {
57
        return $this->db->doQuery( "SELECT id, column1, column2 FROM risoluto_db_test;" );
58
    }
59
60
    /**
61
     * end()
62
     *
63
     * モデルの最終処理を行う
64
     *
65
     * @access    public
66
     *
67
     * @param     void
68
     *
69
     * @return    void    なし
70
     */
71
    public function end()
72
    {
73
        // DB接続を解除する
74
        $this->db->disConnect();
75
    }
76
}