Completed
Push — master ( f463c7...38c89a )
by Pavel
03:01
created

GroupAction::getAttributes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * @copyright   Copyright (c) 2015 ublaboo <[email protected]>
5
 * @author      Pavel Janda <[email protected]>
6
 * @package     Ublaboo
7
 */
8
9
namespace Ublaboo\DataGrid\GroupAction;
10
11
use Nette;
12
13
/**
14
 * @method void onSelect(array $ids, string $value)
15
 */
16
abstract class GroupAction extends Nette\Object
17
{
18
19
	/**
20
	 * @var callable[]
21
	 */
22
	public $onSelect = [];
23
24
	/**
25
	 * @var string
26
	 */
27
	protected $title;
28
29
	/**
30
	 * @var string
31
	 */
32
	protected $class = 'form-control input-sm';
33
34
	/**
35
	 * @var array
36
	 */
37
	protected $attributes = [];
38
39
40
	/**
41
	 * @param string $title
42
	 */
43
	public function __construct($title)
44
	{
45
		$this->title = $title;
46
	}
47
48
49
	/**
50
	 * Get action title
51
	 * @return string
52
	 */
53
	public function getTitle()
54
	{
55
		return $this->title;
56
	}
57
58
59
	/**
60
	 * @param string $class
61
	 * @return static
62
	 */
63
	public function setClass($class)
64
	{
65
		$this->class = (string) $class;
66
67
		return $this;
68
	}
69
70
71
	/**
72
	 * @return string
73
	 */
74
	public function getClass()
75
	{
76
		return $this->class;
77
	}
78
79
80
	/**
81
	 * @param string $key
82
	 * @param mixed $value
83
	 * @return static
84
	 */
85
	public function setAttribute($key, $value)
86
	{
87
		$this->attributes[$key] = $value;
88
		
89
		return $this;
90
	}
91
92
93
	/**
94
	 * @return array
95
	 */
96
	public function getAttributes()
97
	{
98
		return $this->attributes;
99
	}
100
101
}
102