Page MenuHomePhabricator

D19820.diff
No OneTemporary

D19820.diff

diff --git a/src/applications/phortune/query/PhortuneMerchantQuery.php b/src/applications/phortune/query/PhortuneMerchantQuery.php
--- a/src/applications/phortune/query/PhortuneMerchantQuery.php
+++ b/src/applications/phortune/query/PhortuneMerchantQuery.php
@@ -28,20 +28,12 @@
return $this;
}
+ public function newResultObject() {
+ return new PhortuneMerchant();
+ }
+
protected function loadPage() {
- $table = new PhortuneMerchant();
- $conn = $table->establishConnection('r');
-
- $rows = queryfx_all(
- $conn,
- 'SELECT m.* FROM %T m %Q %Q %Q %Q',
- $table->getTableName(),
- $this->buildJoinClause($conn),
- $this->buildWhereClause($conn),
- $this->buildOrderClause($conn),
- $this->buildLimitClause($conn));
-
- return $table->loadAllFromArray($rows);
+ return $this->loadStandardPage($this->newResultObject());
}
protected function willFilterPage(array $merchants) {
@@ -88,8 +80,8 @@
return $merchants;
}
- protected function buildWhereClause(AphrontDatabaseConnection $conn) {
- $where = array();
+ protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
+ $where = parent::buildWhereClauseParts($conn);
if ($this->ids !== null) {
$where[] = qsprintf(
@@ -112,13 +104,11 @@
$this->memberPHIDs);
}
- $where[] = $this->buildPagingClause($conn);
-
- return $this->formatWhereClause($conn, $where);
+ return $where;
}
- protected function buildJoinClause(AphrontDatabaseConnection $conn) {
- $joins = array();
+ protected function buildJoinClauseParts(AphrontDatabaseConnection $conn) {
+ $joins = parent::buildJoinClauseParts($conn);
if ($this->memberPHIDs !== null) {
$joins[] = qsprintf(
@@ -128,11 +118,15 @@
PhortuneMerchantHasMemberEdgeType::EDGECONST);
}
- return implode(' ', $joins);
+ return $joins;
}
public function getQueryApplicationClass() {
return 'PhabricatorPhortuneApplication';
}
+ protected function getPrimaryTableAlias() {
+ return 'm';
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Wed, Dec 4, 9:18 PM (1 h, 43 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6826436
Default Alt Text
D19820.diff (2 KB)

Event Timeline