Passed
Push — master ( 1feb1a...a66fb6 )
by Jason
02:18
created

FileListObject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 48
rs 10
c 0
b 0
f 0
ccs 5
cts 5
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCMSFields() 0 9 1
1
<?php
2
3
namespace Dynamic\Elements\FileList\Model;
4
5
use Dynamic\Elements\FileList\Elements\ElementFileList;
6
use SilverStripe\Assets\File;
7
use SilverStripe\ORM\DataObject;
8
9
class FileListObject extends DataObject
10
{
11
    /**
12
     * @var string
13
     */
14
    private static $singular_name = 'File';
0 ignored issues
show
introduced by
The private property $singular_name is not used, and could be removed.
Loading history...
15
16
    /**
17
     * @var string
18
     */
19
    private static $plural_name = 'Files';
0 ignored issues
show
introduced by
The private property $plural_name is not used, and could be removed.
Loading history...
20
21
    /**
22
     * @var array
23
     */
24
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
25
        'Title' => 'Varchar(255)',
26
    ];
27
28
    /**
29
     * @var array
30
     */
31
    private static $has_one = [
0 ignored issues
show
introduced by
The private property $has_one is not used, and could be removed.
Loading history...
32
        'FileList' => ElementFileList::class,
33
        'File' => File::class,
34
    ];
35
36
    private static $owns = [
0 ignored issues
show
introduced by
The private property $owns is not used, and could be removed.
Loading history...
37
        'File',
38
    ];
39
40
    /**
41
     * @var string
42
     */
43
    private static $table_name = 'FileListObject';
0 ignored issues
show
introduced by
The private property $table_name is not used, and could be removed.
Loading history...
44
45
    /**
46
     * @return \SilverStripe\Forms\FieldList
47
     */
48 1
    public function getCMSFields()
49
    {
50 1
        $fields = parent::getCMSFields();
51
52 1
        $fields->removeByName([
53 1
            'FileListID',
54
        ]);
55
56 1
        return $fields;
57
    }
58
}
59