-
Notifications
You must be signed in to change notification settings - Fork 453
/
LogIdentifierColumn.php
46 lines (37 loc) · 1.16 KB
/
LogIdentifierColumn.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
namespace Concrete\Core\Logging\Search\ColumnSet\Column;
use Concrete\Core\Database\Query\AndWhereNotExistsTrait;
use Concrete\Core\Logging\LogEntry;
use Concrete\Core\Logging\LogList;
use Concrete\Core\Search\Column\Column;
use Concrete\Core\Search\Column\PagerColumnInterface;
use Concrete\Core\Search\ItemList\Pager\PagerProviderInterface;
class LogIdentifierColumn extends Column implements PagerColumnInterface
{
use AndWhereNotExistsTrait;
public function getColumnKey()
{
return 'l.logID';
}
public function getColumnName()
{
return t('ID');
}
public function getColumnCallback()
{
return 'getId';
}
/**
* @param LogList $itemList
* @param $mixed LogEntry
* @noinspection PhpDocSignatureInspection
*/
public function filterListAtOffset(PagerProviderInterface $itemList, $mixed)
{
$query = $itemList->getQueryObject();
$sort = $this->getColumnSortDirection() == 'desc' ? '<' : '>';
$where = sprintf('l.logID %s :logID', $sort);
$query->setParameter('logID', $mixed->getId());
$this->andWhereNotExists($query, $where);
}
}