1 | <?php |
||
14 | abstract class AbstractElement extends AbstractCommon |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * Array of attributes |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $attributes = array(); |
||
22 | |||
23 | /** |
||
24 | * Array of class |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $class = array(); |
||
28 | |||
29 | /** |
||
30 | * Collections of decorators |
||
31 | * @var array |
||
32 | */ |
||
33 | protected $decorators = array(); |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Array of vars class |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $varClass = array(); |
||
41 | |||
42 | /** |
||
43 | * Array of vars attr |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $varAttr= array(); |
||
47 | |||
48 | /** |
||
49 | * Add new class to element |
||
50 | * |
||
51 | * @param string $class |
||
52 | * @return $this |
||
53 | */ |
||
54 | public function addClass($class) |
||
61 | |||
62 | /** |
||
63 | * Remove class from element |
||
64 | * |
||
65 | * @param string $class |
||
66 | * @return $this |
||
67 | */ |
||
68 | public function removeClass($class) |
||
75 | |||
76 | /** |
||
77 | * Add new var class to element |
||
78 | * |
||
79 | * @param string $class |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function addVarClass($class) |
||
89 | |||
90 | /** |
||
91 | * Add new var class to element |
||
92 | * |
||
93 | * @param $name |
||
94 | * @param $value |
||
95 | * @return $this |
||
96 | */ |
||
97 | public function addVarAttr($name, $value) |
||
104 | |||
105 | /** |
||
106 | * Add new attribute to table, header, column or rowset |
||
107 | * |
||
108 | * @param string $name |
||
109 | * @param string $value |
||
110 | * @return mixed |
||
111 | */ |
||
112 | public function addAttr($name, $value) |
||
119 | |||
120 | /** |
||
121 | * Get string class from array |
||
122 | * @return string |
||
123 | */ |
||
124 | public function getClassName() |
||
138 | |||
139 | /** |
||
140 | * Get attributes as a string |
||
141 | * |
||
142 | * @return null|string |
||
143 | */ |
||
144 | public function getAttributes() |
||
165 | |||
166 | /** |
||
167 | * Clearing var classes |
||
168 | */ |
||
169 | public function clearVar() |
||
174 | |||
175 | /** |
||
176 | * Get collestions of decoratos |
||
177 | * @return array |
||
178 | */ |
||
179 | public function getDecorators() |
||
183 | |||
184 | /** |
||
185 | * |
||
186 | * @param $decorators |
||
187 | * @return $this |
||
188 | */ |
||
189 | public function setDecorators($decorators) |
||
194 | |||
195 | /** |
||
196 | * |
||
197 | * @param $decorator |
||
198 | */ |
||
199 | protected function attachDecorator($decorator) |
||
203 | } |
||
204 |