Differential D20411 Diff 48718 src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/typeahead/PhabricatorDashboardPanelDatasource.php
Show All 27 Lines | public function buildResults() { | ||||
$query = new PhabricatorDashboardPanelQuery(); | $query = new PhabricatorDashboardPanelQuery(); | ||||
$raw_query = $this->getRawQuery(); | $raw_query = $this->getRawQuery(); | ||||
if (preg_match('/^[wW]\d+\z/', $raw_query)) { | if (preg_match('/^[wW]\d+\z/', $raw_query)) { | ||||
$id = trim($raw_query, 'wW'); | $id = trim($raw_query, 'wW'); | ||||
$id = (int)$id; | $id = (int)$id; | ||||
$query->withIDs(array($id)); | $query->withIDs(array($id)); | ||||
} else { | } else { | ||||
$query->withNameNgrams($raw_query); | $this->applyFerretConstraints( | ||||
$query, | |||||
id(new PhabricatorDashboardPanel())->newFerretEngine(), | |||||
'title', | |||||
$this->getRawQuery()); | |||||
} | } | ||||
$panels = $this->executeQuery($query); | $panels = $this->executeQuery($query); | ||||
$results = array(); | $results = array(); | ||||
foreach ($panels as $panel) { | foreach ($panels as $panel) { | ||||
$impl = $panel->getImplementation(); | $impl = $panel->getImplementation(); | ||||
if ($impl) { | if ($impl) { | ||||
Show All 31 Lines |