Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/query/PhabricatorDashboardPanelQuery.php
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | final class PhabricatorDashboardPanelQuery | ||||
| } | } | ||||
| 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)', | 'panel.id IN (%Ld)', | ||||
| $this->ids); | $this->ids); | ||||
| } | } | ||||
| if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'phid IN (%Ls)', | 'panel.phid IN (%Ls)', | ||||
| $this->phids); | $this->phids); | ||||
| } | } | ||||
| if ($this->archived !== null) { | if ($this->archived !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'isArchived = %d', | 'panel.isArchived = %d', | ||||
| (int)$this->archived); | (int)$this->archived); | ||||
| } | } | ||||
| if ($this->panelTypes !== null) { | if ($this->panelTypes !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'panelType IN (%Ls)', | 'panel.panelType IN (%Ls)', | ||||
| $this->panelTypes); | $this->panelTypes); | ||||
| } | } | ||||
| if ($this->authorPHIDs !== null) { | if ($this->authorPHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'authorPHID IN (%Ls)', | 'panel.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_panel'; | return 'panel'; | ||||
amckinley: Intentional? At least in my DB, the table looks like `local_dashboard.dashboard_panel`. | |||||
Done Inline ActionsWe SELECT * FROM dashboard_panel AS <this alias> in query construction, so it can be anything, as long as the rest of the query uses the same string. It's mostly so when we join we can disambiguate between various id, phid, dateCreated, etc., columns. I was initially adding a JOIN here but didn't need it, but kept the alias change since it's more consistent with other queries. epriestley: We `SELECT * FROM dashboard_panel AS <this alias>` in query construction, so it can be anything… | |||||
Not Done Inline ActionsAhhh that makes more sense. amckinley: Ahhh that makes more sense. | |||||
| } | } | ||||
| } | } | ||||
Intentional? At least in my DB, the table looks like local_dashboard.dashboard_panel.