Completed
Push — master ( eaf16e...6f8e07 )
by Mohamed
11:01
created

Moo_EditableFieldCheckboxGroup   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 13
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A initFormField() 0 7 2
1
<?php
2
3
/**
4
 * Moo_EditableFieldCheckboxGroup is an object representing a set of selectable radio buttons created by CMS admin.
5
 *
6
 * @package editablefield
7
 *
8
 * @author  Mohamed Alsharaf <[email protected]>
9
 *
10
 * @method HasManyList Options()
11
 */
12
class Moo_EditableFieldCheckboxGroup extends Moo_EditableFieldMultipleOption
13
{
14
    private static $singular_name = 'Checkbox Group';
15
    private static $plural_name   = 'Checkbox Groups';
16
17 1
    protected function initFormField()
18
    {
19 1
        $optionSet = $this->Options();
20 1
        $optionMap = ($optionSet) ? $optionSet->map('EscapedTitle', 'Title') : [];
21
22 1
        return new CheckboxSetField($this->Name, $this->Title, $optionMap);
23
    }
24
}
25