ModEntry::play()   B
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 32
Code Lines 18

Duplication

Lines 32
Ratio 100 %

Importance

Changes 2
Bugs 1 Features 2
Metric Value
c 2
b 1
f 2
dl 32
loc 32
rs 8.8571
cc 2
eloc 18
nc 2
nop 0
1
<?php
2
/**
3
 * ModEntry
4
 *
5
 * グループ情報変更画面(入力)を実現するためのクラス
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\Admin\GroupMng;
17
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21 View Code Duplication
class ModEntry extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface
22
{
23
    // View関連の処理を使用する
24
    use \Risoluto\RisolutoViewTrait;
25
26
    /**
27
     * play()
28
     *
29
     * 主処理を行う
30
     *
31
     * @access    public
32
     *
33
     * @param     void
34
     *
35
     * @return    void    なし
36
     * @throws    \Exception フォームデータを取得できなかった場合はThrow
37
     */
38
    public function play()
39
    {
40
        // セッションをスタート
41
        $sess = new \Risoluto\Session();
42
        $sess->start();
43
44
        // 共通処理クラスを呼び出し
45
        $common = new \RisolutoApps\Admin\AdminCommon;
46
        $detail = $common->loginCheck( $sess, true );
47
48
        if ($sess->isThere( 'form' )) {
49
            // セッションにフォーム入力情報が存在した場合は取得
50
            $entered = $sess->load( 'form' );
51
            $sess->revoke( 'form' );
52
        } else {
53
            // 存在しない場合は例外をThrow
54
            throw new \Exception( 'Cannot get form data.' );
55
        }
56
57
        // ヘッダ情報のセット
58
        $header = $this->getDefaultHeader();
59
        $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' );
60
61
        // テンプレートエンジン関連の処理
62
        $assign_value = [
63
            'header' => $header,
64
            'detail' => $detail,
65
            'entered' => $entered,
66
            'csrf_token' => $sess->load( 'csrf_token' )
67
        ];
68
        $this->risolutoView( $assign_value );
69
    }
70
}