Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / query / PhabricatorCalendarImportLogSearchEngine.php
blob99f292f9a84c15a1fac900acbadc509f05b204e0
1 <?php
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() {
15 return false;
18 public function newQuery() {
19 return new PhabricatorCalendarImportLogQuery();
22 protected function buildCustomSearchFields() {
23 return array(
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']);
38 return $query;
41 protected function getURI($path) {
42 return '/calendar/import/log/'.$path;
45 protected function getBuiltinQueryNames() {
46 $names = array(
47 'all' => pht('All Logs'),
50 return $names;
53 public function buildSavedQueryFromBuiltin($query_key) {
54 $query = $this->newSavedQuery();
55 $query->setQueryKey($query_key);
57 switch ($query_key) {
58 case 'all':
59 return $query;
62 return parent::buildSavedQueryFromBuiltin($query_key);
65 protected function renderResultList(
66 array $logs,
67 PhabricatorSavedQuery $query,
68 array $handles) {
70 assert_instances_of($logs, 'PhabricatorCalendarImportLog');
71 $viewer = $this->requireViewer();
73 $view = id(new PhabricatorCalendarImportLogView())
74 ->setShowImportSources(true)
75 ->setViewer($viewer)
76 ->setLogs($logs);
78 return id(new PhabricatorApplicationSearchResultView())
79 ->setTable($view->newTable());