MapMarkerSetsExtension::updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 18

Duplication

Lines 15
Ratio 83.33 %

Code Coverage

Tests 13
CRAP Score 1

Importance

Changes 0
Metric Value
dl 15
loc 18
ccs 13
cts 13
cp 1
rs 9.6666
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
class MapMarkerSetsExtension extends DataExtension
4
{
5
    public static $many_many = array(
6
        'MapMarkerSets' => 'MapMarkerSet',
7
    );
8
9
    public static $belongs_many_many_extraFields = array(
10
        'MapMarkerSets' => array(
11
            'SortOrder' => 'Int',
12
        ),
13
    );
14
15 1 View Code Duplication
    public function updateCMSFields(FieldList $fields)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
16
    {
17 1
        $gridConfig2 = GridFieldConfig_RelationEditor::create();
18 1
        $gridConfig2->getComponentByType(
19 1
            'GridFieldAddExistingAutocompleter'
20 1
        )->setSearchFields(
21 1
                array('Title')
22
        );
23 1
        $gridConfig2->getComponentByType('GridFieldPaginator')->setItemsPerPage(100);
24 1
25 1
        $gridField2 = new GridField(
26
            'MapMarkerSets',
27 1
            'MapMarker Sets',
28 1
            $this->owner->MapMarkerSets(),
29 1
            $gridConfig2
30
        );
31 1
        $fields->addFieldToTab('Root.MapMarkerSets', $gridField2);
32
    }
33
}
34