/
KeywordsField.php
43 lines (36 loc) · 978 Bytes
/
KeywordsField.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
<?php
namespace Concrete\Core\Logging\Search\Field\Field;
use Concrete\Core\Form\Service\Form;
use Concrete\Core\Logging\LogList;
use Concrete\Core\Search\Field\AbstractField;
use Concrete\Core\Search\ItemList\ItemList;
use Concrete\Core\Support\Facade\Application;
class KeywordsField extends AbstractField
{
protected $requestVariables = [
'keywords'
];
public function getKey()
{
return 'keywords';
}
public function getDisplayName()
{
return t('Keywords');
}
/**
* @param LogList $list
* @noinspection PhpDocSignatureInspection
*/
public function filterList(ItemList $list)
{
$list->filterByKeywords($this->data['keywords']);
}
public function renderSearchField()
{
$app = Application::getFacadeApplication();
/** @var Form $form */
$form = $app->make(Form::class);
return $form->text('keywords' , $this->data['keywords']);
}
}