Passed
Push — master ( aec283...98a649 )
by Thomas
22:11 queued 11:07
created

AbstractTabulatorTool   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 5
eloc 10
c 1
b 0
f 1
dl 0
loc 37
rs 10

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getTabulatorGrid() 0 3 1
A Link() 0 3 1
A setName() 0 4 1
A setTabulatorGrid() 0 4 1
1
<?php
2
3
namespace LeKoala\Tabulator;
4
5
use SilverStripe\Control\RequestHandler;
6
7
/**
8
 * This is the base class for tools (see TabulatorAddNewButton for sample usage)
9
 */
10
class AbstractTabulatorTool extends RequestHandler
11
{
12
    protected TabulatorGrid $tabulatorGrid;
13
14
    protected string $name;
15
16
    /**
17
     * Get the value of tabulatorGrid
18
     */
19
    public function getTabulatorGrid(): TabulatorGrid
20
    {
21
        return $this->tabulatorGrid;
22
    }
23
24
    /**
25
     * Set the value of tabulatorGrid
26
     */
27
    public function setTabulatorGrid(TabulatorGrid $tabulatorGrid): self
28
    {
29
        $this->tabulatorGrid = $tabulatorGrid;
30
        return $this;
31
    }
32
33
    public function getName(): string
34
    {
35
        return $this->name;
36
    }
37
38
    public function setName($name): self
39
    {
40
        $this->name = $name;
41
        return $this;
42
    }
43
44
    public function Link($action = null)
45
    {
46
        return $this->tabulatorGrid->Link('tool/' . $this->name);
47
    }
48
}
49