AuditValue
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 0
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
1
<?php
2
3
namespace SilverStripe\DataObjectAuditor\Models;
4
5
use SilverStripe\ORM\DataObject;
6
7
/**
8
 * Class AuditValue
9
 */
10
class AuditValue extends DataObject
11
{
12
    const DB_FIELD = 'Field';
13
    const DB_PREVIOUS_VALUE = 'PreviousValue';
14
    const HAS_ONE_AUDIT_ID = 'AuditID';
15
    const HAS_ONE_AUDIT = 'Audit';
16
17
    private static $db = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
18
        self::DB_FIELD => 'Varchar(50)',
19
        self::DB_PREVIOUS_VALUE => 'Text',
20
    ];
21
22
    private static $has_one = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $has_one is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
23
        self::HAS_ONE_AUDIT => Audit::class
24
    ];
25
26
    private static $table_name = 'DataObjectAuditor_AuditValue';
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $table_name is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
27
28
    private static $indexes = [
0 ignored issues
show
Comprehensibility introduced by
Consider using a different property name as you override a private property of the parent class.
Loading history...
Unused Code introduced by
The property $indexes is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
29
        'inxAuditAndField' => [
30
            'type' => 'index',
31
            'columns' => [self::DB_FIELD, self::HAS_ONE_AUDIT_ID]
32
        ]
33
    ];
34
}
35