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

AbstractTabulatorTool::getTabulatorGrid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
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