Test Failed
Pull Request — master (#4)
by Simon
10:36
created

MatomoMemberExtension::updateCMSFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 7
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
namespace ElliotSawyer\Matomo;
4
5
use SilverStripe\Forms\CheckboxField;
6
use SilverStripe\ORM\DataExtension;
7
8
/**
9
 * Class \ElliotSawyer\Matomo\MatomoMemberExtension
10
 *
11
 * @property Member|MatomoMemberExtension $owner
12
 * @property boolean $DisableMatomo
13
 */
14
class MatomoMemberExtension extends DataExtension
15
{
16
    private static $db = [
0 ignored issues
show
introduced by
The private property $db is not used, and could be removed.
Loading history...
17
        'DisableMatomo' => 'Boolean'
18
    ];
19
20
    public function updateCMSFields(\SilverStripe\Forms\FieldList $fields)
21
    {
22
        $fields->insertAfter(
23
            'Groups',
24
            CheckboxField::create(
25
                'DisableMatomo',
26
                'Disable Matomo Analytics tracking'
27
            )->setDescription(
28
                'Allow the member to opt-out of Matomo Analytics tracking'
29
            )
30
        );
31
    }
32
}
33