AuditLogRecord::defineAttributes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Craft;
4
5
/**
6
 * Audit Log Record.
7
 *
8
 * Represents the Audit Log tables in the database
9
 *
10
 * @author    Bob Olde Hampsink <[email protected]>
11
 * @copyright Copyright (c) 2015, Bob Olde Hampsink
12
 * @license   MIT
13
 *
14
 * @link      http://github.com/boboldehampsink
15
 */
16
class AuditLogRecord extends BaseRecord
17
{
18
    /**
19
     * Return the table name.
20
     *
21
     * @return string
22
     */
23
    public function getTableName()
24
    {
25
        return 'auditlog';
26
    }
27
28
    /**
29
     * Return the table fields.
30
     *
31
     * @return array
32
     */
33
    protected function defineAttributes()
34
    {
35
        return array(
36
            'type'   => AttributeType::String,
37
            'origin' => AttributeType::String,
38
            'before' => AttributeType::Mixed,
39
            'after'  => AttributeType::Mixed,
40
            'status' => AttributeType::String,
41
        );
42
    }
43
44
    /**
45
     * Define the table relations.
46
     *
47
     * @return array
48
     */
49
    public function defineRelations()
50
    {
51
        return array(
52
            'user'    => array(static::BELONGS_TO, 'UserRecord'),
53
        );
54
    }
55
}
56