Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/query/DifferentialHunkQuery.php
| Show All 40 Lines | $modern_data = queryfx_all( | ||||
| $conn_r, | $conn_r, | ||||
| 'SELECT * FROM %T %Q %Q %Q', | 'SELECT * FROM %T %Q %Q %Q', | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| $this->buildWhereClause($conn_r), | $this->buildWhereClause($conn_r), | ||||
| $this->buildOrderClause($conn_r), | $this->buildOrderClause($conn_r), | ||||
| $this->buildLimitClause($conn_r)); | $this->buildLimitClause($conn_r)); | ||||
| $modern_results = $table->loadAllFromArray($modern_data); | $modern_results = $table->loadAllFromArray($modern_data); | ||||
| // Now, load legacy hunks. | |||||
| $table = new DifferentialLegacyHunk(); | |||||
| $conn_r = $table->establishConnection('r'); | |||||
| $legacy_data = queryfx_all( | |||||
| $conn_r, | |||||
| 'SELECT * FROM %T %Q %Q %Q', | |||||
| $table->getTableName(), | |||||
| $this->buildWhereClause($conn_r), | |||||
| $this->buildOrderClause($conn_r), | |||||
| $this->buildLimitClause($conn_r)); | |||||
| $legacy_results = $table->loadAllFromArray($legacy_data); | |||||
| // Strip all the IDs off since they're not unique and nothing should be | // Strip all the IDs off since they're not unique and nothing should be | ||||
| // using them. | // using them. | ||||
| return array_values(array_merge($legacy_results, $modern_results)); | return array_values($modern_results); | ||||
| } | } | ||||
| protected function willFilterPage(array $hunks) { | protected function willFilterPage(array $hunks) { | ||||
| $changesets = mpull($this->changesets, null, 'getID'); | $changesets = mpull($this->changesets, null, 'getID'); | ||||
| foreach ($hunks as $key => $hunk) { | foreach ($hunks as $key => $hunk) { | ||||
| $changeset = idx($changesets, $hunk->getChangesetID()); | $changeset = idx($changesets, $hunk->getChangesetID()); | ||||
| if (!$changeset) { | if (!$changeset) { | ||||
| unset($hunks[$key]); | unset($hunks[$key]); | ||||
| ▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines | |||||