AddonTableBuilder::setType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
1
<?php namespace Anomaly\PreferencesModule\Preference\Table;
2
3
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
4
5
/**
6
 * Class AddonTableBuilder
7
 *
8
 * @link          http://pyrocms.com/
9
 * @author        PyroCMS, Inc. <[email protected]>
10
 * @author        Ryan Thompson <[email protected]>
11
 */
12
class AddonTableBuilder extends TableBuilder
13
{
14
15
    /**
16
     * The addon type.
17
     *
18
     * @var string
19
     */
20
    protected $type;
21
22
    /**
23
     * The table columns.
24
     *
25
     * @var array
26
     */
27
    protected $columns = [
28
        [
29
            'heading' => 'module::field.name.name',
30
            'value'   => 'entry.name',
31
        ],
32
        [
33
            'heading' => 'module::field.description.name',
34
            'value'   => 'entry.description',
35
        ],
36
    ];
37
38
    /**
39
     * The table buttons.
40
     *
41
     * @var array
42
     */
43
    protected $buttons = [
44
        'preferences' => [
45
            'href' => 'admin/preferences/{request.route.parameters.type}/{entry.namespace}',
46
        ],
47
    ];
48
49
    /**
50
     * Get the type.
51
     *
52
     * @return string
53
     */
54
    public function getType()
55
    {
56
        return $this->type;
57
    }
58
59
    /**
60
     * Set the type.
61
     *
62
     * @param $type
63
     * @return $this
64
     */
65
    public function setType($type)
66
    {
67
        $this->type = $type;
68
69
        return $this;
70
    }
71
}
72