3 final class PhabricatorCalendarImportLogSearchEngine
4 extends PhabricatorApplicationSearchEngine
{
6 public function getResultTypeDescription() {
7 return pht('Calendar Import Logs');
10 public function getApplicationClassName() {
11 return 'PhabricatorCalendarApplication';
14 public function canUseInPanelContext() {
18 public function newQuery() {
19 return new PhabricatorCalendarImportLogQuery();
22 protected function buildCustomSearchFields() {
24 id(new PhabricatorPHIDsSearchField())
25 ->setLabel(pht('Import Sources'))
26 ->setKey('importSourcePHIDs')
27 ->setAliases(array('importSourcePHID')),
31 protected function buildQueryFromParameters(array $map) {
32 $query = $this->newQuery();
34 if ($map['importSourcePHIDs']) {
35 $query->withImportPHIDs($map['importSourcePHIDs']);
41 protected function getURI($path) {
42 return '/calendar/import/log/'.$path;
45 protected function getBuiltinQueryNames() {
47 'all' => pht('All Logs'),
53 public function buildSavedQueryFromBuiltin($query_key) {
54 $query = $this->newSavedQuery();
55 $query->setQueryKey($query_key);
62 return parent
::buildSavedQueryFromBuiltin($query_key);
65 protected function renderResultList(
67 PhabricatorSavedQuery
$query,
70 assert_instances_of($logs, 'PhabricatorCalendarImportLog');
71 $viewer = $this->requireViewer();
73 $view = id(new PhabricatorCalendarImportLogView())
74 ->setShowImportSources(true)
78 return id(new PhabricatorApplicationSearchResultView())
79 ->setTable($view->newTable());