1: <?php
2:
3: namespace Mesour\DataGrid\Render;
4:
5: use Mesour\DataGrid\Column;
6:
7: /**
8: * @author mesour <matous.nemec@mesour.com>
9: * @package Mesour DataGrid
10: */
11: abstract class Attributes {
12:
13: /**
14: * @var array
15: */
16: protected $attributes = array();
17:
18: public function setAttributes(array $attributes = array()) {
19: $this->attributes = $attributes;
20: }
21:
22: /**
23: * @param $key
24: * @param $value
25: * @param bool $append
26: * @deprecated
27: */
28: public function addAttribute($key, $value, $append = FALSE) {
29: $this->setAttribute($key, $value, $append);
30: }
31:
32: public function setAttribute($key, $value, $append = FALSE) {
33: if($append && isset($this->attributes[$key])) {
34: $this->attributes[$key] = $this->attributes[$key] . ' ' . $value;
35: } else {
36: $this->attributes[$key] = $value;
37: }
38: return $this;
39: }
40:
41: }