PoptinSiteConfig::updateCMSFields()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 4
c 2
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Poptin\Silverstripe;
4
5
use SilverStripe\Forms\FieldList;
6
use SilverStripe\Forms\TextField;
7
use SilverStripe\ORM\DataExtension;
8
9
class PoptinSiteConfig extends DataExtension
10
{
11
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
12
        'PoptinConfig' => 'Text'
13
    ];
14
15
    public function updateCMSFields(FieldList $fields)
16
    {
17
        $fields->addFieldToTab(
18
            "Root.Main",
19
            new TextField("PoptinConfig", "Poptin Config")
20
        );
21
        $fields->removeByName(['PoptinConfig']);
22
    }
23
}
24