Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/query/PhabricatorDashboardQuery.php
Show All 28 Lines | public function withAuthorPHIDs(array $authors) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withCanEdit($can_edit) { | public function withCanEdit($can_edit) { | ||||
$this->canEdit = $can_edit; | $this->canEdit = $can_edit; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withNameNgrams($ngrams) { | |||||
return $this->withNgramsConstraint( | |||||
id(new PhabricatorDashboardNgrams()), | |||||
$ngrams); | |||||
} | |||||
protected function loadPage() { | protected function loadPage() { | ||||
return $this->loadStandardPage($this->newResultObject()); | return $this->loadStandardPage($this->newResultObject()); | ||||
} | } | ||||
public function newResultObject() { | public function newResultObject() { | ||||
return new PhabricatorDashboard(); | return new PhabricatorDashboard(); | ||||
} | } | ||||
Show All 14 Lines | final class PhabricatorDashboardQuery | ||||
} | } | ||||
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
$where = parent::buildWhereClauseParts($conn); | $where = parent::buildWhereClauseParts($conn); | ||||
if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'id IN (%Ld)', | 'dashboard.id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'phid IN (%Ls)', | 'dashboard.phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->statuses !== null) { | if ($this->statuses !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'status IN (%Ls)', | 'dashboard.status IN (%Ls)', | ||||
$this->statuses); | $this->statuses); | ||||
} | } | ||||
if ($this->authorPHIDs !== null) { | if ($this->authorPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'authorPHID IN (%Ls)', | 'dashboard.authorPHID IN (%Ls)', | ||||
$this->authorPHIDs); | $this->authorPHIDs); | ||||
} | } | ||||
return $where; | return $where; | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorDashboardApplication'; | return 'PhabricatorDashboardApplication'; | ||||
} | } | ||||
protected function getPrimaryTableAlias() { | protected function getPrimaryTableAlias() { | ||||
return 'dashboard'; | return 'dashboard'; | ||||
} | } | ||||
} | } |