Completed
Push — master ( cc6000...14f10a )
by Adam
03:11
created

Action::getRowActions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Boduch\Grid;
4
5
class Action extends Cell
6
{
7
    /**
8
     * @var Components\RowAction[]
9
     */
10
    protected $rowActions;
11
12
    /**
13
     * @param mixed $value
14
     */
15
    public function setValue($value)
16
    {
17
        throw new \InvalidArgumentException('Can\'t set action value in action column.');
18
    }
19
20
    /**
21
     * @return Components\RowAction[]
22
     */
23
    public function getRowActions(): array
24
    {
25
        return $this->rowActions;
26
    }
27
28
    /**
29
     * @param Components\RowAction[] $rowActions
30
     * @return $this
31
     */
32
    public function setRowActions(array $rowActions)
33
    {
34
        $this->rowActions = $rowActions;
35
36
        return $this;
37
    }
38
39
    /**
40
     * @return string
41
     */
42
    public function getValue()
43
    {
44
        $html = '';
45
46
        foreach ($this->rowActions as $rowAction) {
47
            $html = $rowAction->render($this->data);
48
        }
49
50
        return $html;
51
    }
52
53
    protected function decorate()
54
    {
55
        return null;
56
    }
57
58
    protected function setupValue()
59
    {
60
        //
61
    }
62
}
63