Passed
Push — master ( 7c40b0...1b7f17 )
by Matthew
02:45
created

CategoryExtension::updateCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 0
cts 5
cp 0
crap 2
rs 10
1
<?php
2
3
namespace Dynamic\Locator\React\Extensions;
4
5
use Dynamic\Locator\LocationCategory;
6
use SilverStripe\AssetAdmin\Forms\UploadField;
7
use SilverStripe\Assets\Image;
8
use SilverStripe\Forms\FieldList;
9
use SilverStripe\ORM\DataExtension;
10
11
/**
12
 * Class CategoryExtension
13
 * @package Dynamic\Locator\React\Extensions
14
 *
15
 * @property int MarkerIconImageID
16
 * @method Image MarkerIconImage()
17
 *
18
 * @property-read LocationCategory|CategoryExtension $owner
19
 */
20
class CategoryExtension extends DataExtension
21
{
22
    /**
23
     * @var array
24
     */
25
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
26
        'MarkerIconImage' => Image::class,
27
    ];
28
    
29
    /**
30
     * @var array
31
     */
32
    private static $owns = [
0 ignored issues
show
introduced by
The private property $owns is not used, and could be removed.
Loading history...
33
        'MarkerIconImage',
34
    ];
35
36
37
    public function updateCMSFields(FieldList $fields)
38
    {
39
        parent::updateCMSFields($fields);
40
41
        $fields->insertAfter(
42
            'Title',
43
            UploadField::create('MarkerIconImage', 'Marker Icon')
44
        );
45
    }
46
}
47