Skip to content

Commit f5580c7

Browse files
author
epriestley
committed
Make buildWhereClause() a method of AphrontCursorPagedPolicyAwareQuery
Summary: Ref T4100. Ref T5595. To support a unified "Projects:" query across all applications, a future diff is going to add a set of "Edge Logic" capabilities to `PolicyAwareQuery` which write the required SELECT, JOIN, WHERE, HAVING and GROUP clauses for you. With the addition of "Edge Logic", we'll have three systems which may need to build components of query claues: ordering/paging, customfields/applicationsearch, and edge logic. For most clauses, queries don't currently call into the parent explicitly to get default components. I want to move more query construction logic up the class tree so it can be shared. For most methods, this isn't a problem, but many subclasses define a `buildWhereClause()`. Make all such definitions protected and consistent. This causes no behavioral changes. Test Plan: Ran `arc unit --everything`, which does a pretty through job of verifying this statically. Reviewers: btrahan Reviewed By: btrahan Subscribers: yelirekim, hach-que, epriestley Maniphest Tasks: T4100, T5595 Differential Revision: https://secure.phabricator.com/D12453
1 parent 01c9933 commit f5580c7

File tree

114 files changed

+162
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

114 files changed

+162
-116
lines changed

src/applications/almanac/query/AlmanacBindingQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected function willFilterPage(array $bindings) {
9393
return $bindings;
9494
}
9595

96-
protected function buildWhereClause($conn_r) {
96+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
9797
$where = array();
9898

9999
if ($this->ids !== null) {

src/applications/almanac/query/AlmanacDeviceQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function loadPage() {
4949
return $table->loadAllFromArray($data);
5050
}
5151

52-
protected function buildWhereClause($conn_r) {
52+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
5353
$where = array();
5454

5555
if ($this->ids !== null) {

src/applications/almanac/query/AlmanacInterfaceQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ protected function willFilterPage(array $interfaces) {
8383
return $interfaces;
8484
}
8585

86-
protected function buildWhereClause($conn_r) {
86+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
8787
$where = array();
8888

8989
if ($this->ids !== null) {

src/applications/almanac/query/AlmanacNetworkQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function loadPage() {
3131
return $table->loadAllFromArray($data);
3232
}
3333

34-
protected function buildWhereClause($conn_r) {
34+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
3535
$where = array();
3636

3737
if ($this->ids !== null) {

src/applications/almanac/query/AlmanacPropertyQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ protected function willFilterPage(array $properties) {
7171
return $properties;
7272
}
7373

74-
protected function buildWhereClause($conn_r) {
74+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
7575
$where = array();
7676

7777
if ($this->ids !== null) {

src/applications/almanac/query/AlmanacServiceQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ protected function buildJoinClause($conn_r) {
8888
return implode(' ', $joins);
8989
}
9090

91-
protected function buildWhereClause($conn_r) {
91+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
9292
$where = array();
9393

9494
if ($this->ids !== null) {

src/applications/calendar/query/PhabricatorCalendarEventQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function loadPage() {
5151
return $table->loadAllFromArray($data);
5252
}
5353

54-
protected function buildWhereClause($conn_r) {
54+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
5555
$where = array();
5656

5757
if ($this->ids) {

src/applications/chatlog/query/PhabricatorChatLogChannelQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function loadPage() {
3333
return $logs;
3434
}
3535

36-
private function buildWhereClause($conn_r) {
36+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
3737
$where = array();
3838

3939
$where[] = $this->buildPagingClause($conn_r);

src/applications/chatlog/query/PhabricatorChatLogQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function willFilterPage(array $events) {
5555
return $events;
5656
}
5757

58-
private function buildWhereClause($conn_r) {
58+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
5959
$where = array();
6060

6161
$where[] = $this->buildPagingClause($conn_r);

src/applications/conduit/query/PhabricatorConduitLogQuery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function loadPage() {
2525
return $table->loadAllFromArray($data);;
2626
}
2727

28-
private function buildWhereClause(AphrontDatabaseConnection $conn_r) {
28+
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
2929
$where = array();
3030

3131
if ($this->methods) {

0 commit comments

Comments
 (0)