/
Available.php
36 lines (29 loc) · 1.03 KB
/
Available.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
<?php
namespace Concrete\Core\Express\Search\ColumnSet;
use Concrete\Core\Attribute\Category\ExpressCategory;
use Concrete\Core\Entity\Express\Entry;
use Concrete\Core\Express\Search\ColumnSet\Column\AssociationColumn;
use Concrete\Core\Search\Column\Column;
class Available extends DefaultSet
{
public function getAuthor(Entry $entry)
{
$author = $entry->getAuthor();
if ($author) {
$ui = $author->getUserInfoObject();
if ($ui) {
return $ui->getUserDisplayName();
}
}
}
public function __construct(ExpressCategory $category)
{
parent::__construct($category);
$this->addColumn(new Column('e.uID', t('Author'), array('\Concrete\Core\Express\Search\ColumnSet\Available', 'getAuthor'), false));
$associations = $category->getExpressEntity()->getAssociations();
foreach($associations as $association) {
$column = new AssociationColumn($association);
$this->addColumn($column);
}
}
}