@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Modernize Nuance queries and search engines

Summary: Ref T10537. Minor updates to simplify and modernize these codepaths.

Test Plan: Searched for queues and sources.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10537

Differential Revision: https://secure.phabricator.com/D15429

+24 -48
-4
src/applications/almanac/query/AlmanacServiceSearchEngine.php
··· 15 15 return new AlmanacServiceQuery(); 16 16 } 17 17 18 - public function newResultObject() { 19 - return new AlmanacService(); 20 - } 21 - 22 18 protected function buildQueryFromParameters(array $map) { 23 19 $query = $this->newQuery(); 24 20
+5 -13
src/applications/nuance/query/NuanceQueueQuery.php
··· 16 16 return $this; 17 17 } 18 18 19 - protected function loadPage() { 20 - $table = new NuanceQueue(); 21 - $conn = $table->establishConnection('r'); 22 - 23 - $data = queryfx_all( 24 - $conn, 25 - '%Q FROM %T %Q %Q %Q', 26 - $this->buildSelectClause($conn), 27 - $table->getTableName(), 28 - $this->buildWhereClause($conn), 29 - $this->buildOrderClause($conn), 30 - $this->buildLimitClause($conn)); 19 + public function newResultObject() { 20 + return new NuanceQueue(); 21 + } 31 22 32 - return $table->loadAllFromArray($data); 23 + protected function loadPage() { 24 + return $this->loadStandardPage($this->newResultObject()); 33 25 } 34 26 35 27 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
+7 -9
src/applications/nuance/query/NuanceQueueSearchEngine.php
··· 11 11 return pht('Nuance Queues'); 12 12 } 13 13 14 - public function buildSavedQueryFromRequest(AphrontRequest $request) { 15 - $saved = new PhabricatorSavedQuery(); 16 - 17 - return $saved; 14 + public function newQuery() { 15 + return new NuanceQueueQuery(); 18 16 } 19 17 20 - public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { 21 - $query = id(new NuanceQueueQuery()); 18 + protected function buildQueryFromParameters(array $map) { 19 + $query = $this->newQuery(); 22 20 23 21 return $query; 24 22 } 25 23 26 - public function buildSearchForm( 27 - AphrontFormView $form, 28 - PhabricatorSavedQuery $saved_query) {} 24 + protected function buildCustomSearchFields() { 25 + return array(); 26 + } 29 27 30 28 protected function getURI($path) { 31 29 return '/nuance/queue/'.$path;
+5 -13
src/applications/nuance/query/NuanceSourceQuery.php
··· 22 22 return $this; 23 23 } 24 24 25 - protected function loadPage() { 26 - $table = new NuanceSource(); 27 - $conn = $table->establishConnection('r'); 28 - 29 - $data = queryfx_all( 30 - $conn, 31 - '%Q FROM %T %Q %Q %Q', 32 - $this->buildSelectClause($conn), 33 - $table->getTableName(), 34 - $this->buildWhereClause($conn), 35 - $this->buildOrderClause($conn), 36 - $this->buildLimitClause($conn)); 25 + public function newResultObject() { 26 + return new NuanceSource(); 27 + } 37 28 38 - return $table->loadAllFromArray($data); 29 + protected function loadPage() { 30 + return $this->loadStandardPage($this->newResultObject()); 39 31 } 40 32 41 33 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
+7 -9
src/applications/nuance/query/NuanceSourceSearchEngine.php
··· 11 11 return pht('Nuance Sources'); 12 12 } 13 13 14 - public function buildSavedQueryFromRequest(AphrontRequest $request) { 15 - $saved = new PhabricatorSavedQuery(); 16 - 17 - return $saved; 14 + public function newQuery() { 15 + return new NuanceSourceQuery(); 18 16 } 19 17 20 - public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { 21 - $query = id(new NuanceSourceQuery()); 18 + protected function buildQueryFromParameters(array $map) { 19 + $query = $this->newQuery(); 22 20 23 21 return $query; 24 22 } 25 23 26 - public function buildSearchForm( 27 - AphrontFormView $form, 28 - PhabricatorSavedQuery $saved_query) {} 24 + protected function buildCustomSearchFields() { 25 + return array(); 26 + } 29 27 30 28 protected function getURI($path) { 31 29 return '/nuance/source/'.$path;