Completed
Push — develop ( 8cf0c8...02dd7c )
by Nate
03:19
created

EntryList   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 3
dl 0
loc 37
ccs 0
cts 20
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A init() 0 8 1
A displayName() 0 4 1
A settingsAttributes() 0 9 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipboxfactory/craft-element-lists/LICENSE
6
 * @link       https://github.com/flipboxfactory/craft-element-lists/
7
 */
8
9
namespace flipbox\craft\element\lists\fields;
10
11
use craft\fields\Entries;
12
use flipbox\craft\element\lists\ElementList;
13
14
/**
15
 * @author Flipbox Factory <[email protected]>
16
 * @since 1.0.0
17
 */
18
class EntryList extends Entries implements SortableInterface
19
{
20
    use ElementListTrait;
21
22
    /**
23
     * @inheritdoc
24
     */
25
    public function init()
26
    {
27
        parent::init();
28
29
        $this->settingsTemplate = 'element-lists/_components/fieldtypes/settings';
30
        $this->inputTemplate = 'element-lists/_components/fieldtypes/input';
31
        $this->inputJsClass = 'Craft.NestedElementIndexSelectInput';
32
    }
33
34
    /**
35
     * @inheritdoc
36
     */
37
    public static function displayName(): string
38
    {
39
        return ElementList::t('Entry List');
40
    }
41
42
    /**
43
     * @inheritdoc
44
     */
45
    public function settingsAttributes(): array
46
    {
47
        return array_merge(
48
            parent::settingsAttributes(),
49
            [
50
                'sortable'
51
            ]
52
        );
53
    }
54
}
55