Skip to content

Commit de939c0

Browse files
committed
Move back the functions to headcell
1 parent 054e359 commit de939c0

File tree

2 files changed

+84
-84
lines changed

2 files changed

+84
-84
lines changed

src/PhpTableGenerator/HeadCell.php

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ class HeadCell extends Cell
5353
*/
5454
private $selectAllSelector;
5555

56+
/**
57+
* @var
58+
*/
59+
private $listSortByKey;
60+
61+
/**
62+
* @var
63+
*/
64+
private $listSortBy;
65+
66+
/**
67+
* @var
68+
*/
69+
private $listSortDirKey;
70+
71+
/**
72+
* @var
73+
*/
74+
private $listSortDir;
75+
5676
public function __construct($title = null, $alias = null, $content = null, $htmlspecialchars = false)
5777
{
5878
if ($title !== null) {
@@ -185,6 +205,70 @@ public function getSortDir()
185205
return ($alias === $listSortBy && $listSortDir === 'asc') ? 'desc' : 'asc';
186206
}
187207

208+
/**
209+
* @return string
210+
*/
211+
public function getListSortByKey()
212+
{
213+
return $this->listSortByKey;
214+
}
215+
216+
/**
217+
* @param string $listSortByKey
218+
*/
219+
public function setListSortByKey($listSortByKey)
220+
{
221+
$this->listSortByKey = $listSortByKey;
222+
}
223+
224+
/**
225+
* @return string
226+
*/
227+
public function getListSortBy()
228+
{
229+
return $this->listSortBy;
230+
}
231+
232+
/**
233+
* @param string $listSortBy
234+
*/
235+
public function setListSortBy($listSortBy)
236+
{
237+
$this->listSortBy = $listSortBy;
238+
}
239+
240+
/**
241+
* @return string
242+
*/
243+
public function getListSortDirKey()
244+
{
245+
return $this->listSortDirKey;
246+
}
247+
248+
/**
249+
* @param string $listSortDirKey
250+
*/
251+
public function setListSortDirKey($listSortDirKey)
252+
{
253+
$this->listSortDirKey = $listSortDirKey;
254+
}
255+
256+
/**
257+
* @return string
258+
*/
259+
public function getListSortDir()
260+
{
261+
return $this->listSortDir;
262+
}
263+
264+
/**
265+
* @param $listSortDir
266+
*/
267+
public function setListSortDir($listSortDir)
268+
{
269+
$this->listSortDir = (strtolower($listSortDir) === 'asc') ? 'asc' : 'desc';
270+
}
271+
188272
/**
189273
* @return string
190274
* @throws \Exception

src/PhpTableGenerator/TableGenerator.php

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,6 @@ abstract class TableGenerator
4343
*/
4444
private $data;
4545

46-
/**
47-
* @var
48-
*/
49-
private $listSortByKey;
50-
51-
/**
52-
* @var
53-
*/
54-
private $listSortBy;
55-
56-
/**
57-
* @var
58-
*/
59-
private $listSortDirKey;
60-
61-
/**
62-
* @var
63-
*/
64-
private $listSortDir;
65-
6646
/**
6747
* initialize a TableGenerator object
6848
*
@@ -150,68 +130,4 @@ public function getAllAttributesHtml()
150130
* @return string
151131
*/
152132
abstract public function getHtml();
153-
154-
/**
155-
* @return string
156-
*/
157-
public function getListSortByKey()
158-
{
159-
return $this->listSortByKey;
160-
}
161-
162-
/**
163-
* @param string $listSortByKey
164-
*/
165-
public function setListSortByKey($listSortByKey)
166-
{
167-
$this->listSortByKey = $listSortByKey;
168-
}
169-
170-
/**
171-
* @return string
172-
*/
173-
public function getListSortBy()
174-
{
175-
return $this->listSortBy;
176-
}
177-
178-
/**
179-
* @param string $listSortBy
180-
*/
181-
public function setListSortBy($listSortBy)
182-
{
183-
$this->listSortBy = $listSortBy;
184-
}
185-
186-
/**
187-
* @return string
188-
*/
189-
public function getListSortDirKey()
190-
{
191-
return $this->listSortDirKey;
192-
}
193-
194-
/**
195-
* @param string $listSortDirKey
196-
*/
197-
public function setListSortDirKey($listSortDirKey)
198-
{
199-
$this->listSortDirKey = $listSortDirKey;
200-
}
201-
202-
/**
203-
* @return string
204-
*/
205-
public function getListSortDir()
206-
{
207-
return $this->listSortDir;
208-
}
209-
210-
/**
211-
* @param $listSortDir
212-
*/
213-
public function setListSortDir($listSortDir)
214-
{
215-
$this->listSortDir = (strtolower($listSortDir) === 'asc') ? 'asc' : 'desc';
216-
}
217133
}

0 commit comments

Comments
 (0)