Settings   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTableName() 0 4 1
A defineAttributes() 0 22 1
A defineIndexes() 0 15 1
1
<?php
2
/**
3
 * mithra62 - Craft Settings Base
4
 *
5
 * @copyright	Copyright (c) 2015, mithra62, Eric Lamb.
6
 * @link		http://mithra62.com/
7
 * @version		1.0
8
 * @filesource 	./mithra62/Platforms/Craft/Records/Settings.php
9
 */
10
namespace mithra62\Platforms\Craft\Records;
11
12
use Craft\AttributeType;
13
use Craft\ColumnType;
14
use mithra62\Platforms\Craft\Records;
15
16
/**
17
 * Craft - mithra62 Settings Record
18
 *
19
 * Contains the global mithra62 Settings object for Craft usage
20
 *
21
 * @package Platforms\Craft
22
 * @author Eric Lamb <[email protected]>
23
 */
24
class Settings extends Records
25
{
26
27
    /**
28
     * (non-PHPdoc)
29
     * 
30
     * @see \Craft\BaseRecord::getTableName()
31
     */
32
    public function getTableName()
33
    {
34
        return 'mithra62_settings';
35
    }
36
37
    /**
38
     * (non-PHPdoc)
39
     * 
40
     * @see \Craft\BaseRecord::defineAttributes()
41
     */
42
    protected function defineAttributes()
43
    {
44
        return array(
45
            'setting_key' => array(
46
                AttributeType::String,
47
                'colum' => ColumnType::Varchar,
48
                'required' => true
49
            ),
50
            'setting_value' => array(
51
                AttributeType::String,
52
                'column' => ColumnType::LongText,
53
                'required' => false
54
            ),
55
            'serialized' => array(
56
                AttributeType::Number,
57
                'column' => ColumnType::TinyInt,
58
                'required' => false,
59
                'default' => 0,
60
                'length' => 1
61
            )
62
        );
63
    }
64
65
    /**
66
     * (non-PHPdoc)
67
     * 
68
     * @see \Craft\BaseRecord::defineIndexes()
69
     */
70
    public function defineIndexes()
71
    {
72
        return array(
73
            array(
74
                'columns' => array(
75
                    'setting_key'
76
                )
77
            ),
78
            array(
79
                'columns' => array(
80
                    'serialized'
81
                )
82
            )
83
        );
84
    }
85
}