Passed
Push — 4 ( 02c973...b5c3b6 )
by Steve
06:49 queued 12s
created

Team_Extension   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
dl 0
loc 23
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getExtendedDynamicField() 0 3 1
A augmentHydrateFields() 0 4 1
1
<?php
2
3
namespace SilverStripe\ORM\Tests\DataObjectTest;
4
5
use SilverStripe\Dev\TestOnly;
6
use SilverStripe\ORM\DataExtension;
7
8
class Team_Extension extends DataExtension implements TestOnly
9
{
10
    private static $summary_fields = [
0 ignored issues
show
introduced by
The private property $summary_fields is not used, and could be removed.
Loading history...
11
        'Title' => 'Custom Title', // override non-associative 'Title'
12
    ];
13
14
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
15
        'ExtendedDatabaseField' => 'Varchar'
16
    ];
17
18
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
19
        'ExtendedHasOneRelationship' => Player::class
20
    ];
21
22
    public function getExtendedDynamicField()
23
    {
24
        return "extended dynamic field";
25
    }
26
27
    public function augmentHydrateFields()
28
    {
29
        return [
30
            'CustomHydratedField' => true,
31
        ];
32
    }
33
}
34