Page MenuHomePhabricator

D18420.id44264.diff
No OneTemporary

D18420.id44264.diff

diff --git a/src/applications/search/query/PhabricatorNamedQueryQuery.php b/src/applications/search/query/PhabricatorNamedQueryQuery.php
--- a/src/applications/search/query/PhabricatorNamedQueryQuery.php
+++ b/src/applications/search/query/PhabricatorNamedQueryQuery.php
@@ -28,55 +28,46 @@
return $this;
}
+ public function newResultObject() {
+ return new PhabricatorNamedQuery();
+ }
+
protected function loadPage() {
- $table = new PhabricatorNamedQuery();
- $conn_r = $table->establishConnection('r');
-
- $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));
-
- return $table->loadAllFromArray($data);
+ return $this->loadStandardPage($this->newResultObject());
}
- protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
- $where = array();
+ protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
+ $where = parent::buildWhereClauseParts($conn);
- if ($this->ids) {
+ if ($this->ids !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'id IN (%Ld)',
$this->ids);
}
- if ($this->engineClassNames) {
+ if ($this->engineClassNames !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'engineClassName IN (%Ls)',
$this->engineClassNames);
}
- if ($this->userPHIDs) {
+ if ($this->userPHIDs !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'userPHID IN (%Ls)',
$this->userPHIDs);
}
- if ($this->queryKeys) {
+ if ($this->queryKeys !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'queryKey IN (%Ls)',
$this->queryKeys);
}
- $where[] = $this->buildPagingClause($conn_r);
-
- return $this->formatWhereClause($where);
+ return $where;
}
public function getQueryApplicationClass() {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 1:49 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7705042
Default Alt Text
D18420.id44264.diff (2 KB)

Event Timeline