From b0fda3be25ac8d7eb63d94cc56fce8df36c5ff97 Mon Sep 17 00:00:00 2001 From: epriestley Date: Tue, 7 Aug 2012 11:54:24 -0700 Subject: [PATCH] Rename setMembers() to withMemberPHIDs() in PhabricatorProjectQuery Summary: This is clearer and more consistent with other Query classes. Test Plan: Used home page, conduit api, project list, other interfaces. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D3179 --- .../audit/editor/PhabricatorAuditCommentEditor.php | 2 +- .../method/project/ConduitAPI_project_query_Method.php | 2 +- .../controller/PhabricatorDirectoryMainController.php | 2 +- .../controller/ManiphestTaskListController.php | 2 +- .../owners/storage/PhabricatorOwnersOwner.php | 9 ++++----- .../controller/PhabricatorProjectListController.php | 2 +- .../project/query/PhabricatorProjectQuery.php | 10 +++++----- 7 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php index 8a352a3a72..956f8e24f4 100644 --- a/src/applications/audit/editor/PhabricatorAuditCommentEditor.php +++ b/src/applications/audit/editor/PhabricatorAuditCommentEditor.php @@ -323,7 +323,7 @@ final class PhabricatorAuditCommentEditor { // The user can audit on behalf of all projects they are a member of. $query = new PhabricatorProjectQuery(); - $query->setMembers(array($user->getPHID())); + $query->withMemberPHIDs(array($user->getPHID())); $projects = $query->execute(); foreach ($projects as $project) { $phids[$project->getPHID()] = true; diff --git a/src/applications/conduit/method/project/ConduitAPI_project_query_Method.php b/src/applications/conduit/method/project/ConduitAPI_project_query_Method.php index 28b312739e..e8404dcb5d 100644 --- a/src/applications/conduit/method/project/ConduitAPI_project_query_Method.php +++ b/src/applications/conduit/method/project/ConduitAPI_project_query_Method.php @@ -77,7 +77,7 @@ final class ConduitAPI_project_query_Method extends ConduitAPI_project_Method { $members = $request->getValue('members'); if ($members) { - $query->setMembers($members); + $query->withMemberPHIDs($members); } $limit = $request->getValue('limit'); diff --git a/src/applications/directory/controller/PhabricatorDirectoryMainController.php b/src/applications/directory/controller/PhabricatorDirectoryMainController.php index 5fd117f911..7cd7424b1e 100644 --- a/src/applications/directory/controller/PhabricatorDirectoryMainController.php +++ b/src/applications/directory/controller/PhabricatorDirectoryMainController.php @@ -40,7 +40,7 @@ final class PhabricatorDirectoryMainController case 'home': case 'feed': $project_query = new PhabricatorProjectQuery(); - $project_query->setMembers(array($user->getPHID())); + $project_query->withMemberPHIDs(array($user->getPHID())); $projects = $project_query->execute(); break; default: diff --git a/src/applications/maniphest/controller/ManiphestTaskListController.php b/src/applications/maniphest/controller/ManiphestTaskListController.php index 69fdb0ce6f..7a0d88b74b 100644 --- a/src/applications/maniphest/controller/ManiphestTaskListController.php +++ b/src/applications/maniphest/controller/ManiphestTaskListController.php @@ -700,7 +700,7 @@ final class ManiphestTaskListController extends ManiphestController { if ($this->view == 'projecttriage' || $this->view == 'projectall') { $project_query = new PhabricatorProjectQuery(); - $project_query->setMembers($user_phids); + $project_query->withMemberPHIDs($user_phids); $projects = $project_query->execute(); $project_phids = mpull($projects, 'getPHID'); } else { diff --git a/src/applications/owners/storage/PhabricatorOwnersOwner.php b/src/applications/owners/storage/PhabricatorOwnersOwner.php index 8d9a8663be..72f35a2b06 100644 --- a/src/applications/owners/storage/PhabricatorOwnersOwner.php +++ b/src/applications/owners/storage/PhabricatorOwnersOwner.php @@ -73,14 +73,13 @@ final class PhabricatorOwnersOwner extends PhabricatorOwnersDAO { // any project the user is a member of. public static function loadAffiliatedPackages($user_phid) { $query = new PhabricatorProjectQuery(); - $query->setMembers(array($user_phid)); + $query->withMemberPHIDs(array($user_phid)); $query->withStatus(PhabricatorProjectQuery::STATUS_ACTIVE); $projects = $query->execute(); $phids = mpull($projects, 'getPHID') + array($user_phid); - return - id(new PhabricatorOwnersOwner())->loadAllWhere( - 'userPHID in (%Ls)', - $phids); + return id(new PhabricatorOwnersOwner())->loadAllWhere( + 'userPHID in (%Ls)', + $phids); } } diff --git a/src/applications/project/controller/PhabricatorProjectListController.php b/src/applications/project/controller/PhabricatorProjectListController.php index 4dab336181..78536e9c33 100644 --- a/src/applications/project/controller/PhabricatorProjectListController.php +++ b/src/applications/project/controller/PhabricatorProjectListController.php @@ -55,7 +55,7 @@ final class PhabricatorProjectListController switch ($this->filter) { case 'active': $table_header = 'Your Projects'; - $query->setMembers(array($view_phid)); + $query->withMemberPHIDs(array($view_phid)); $query->withStatus(PhabricatorProjectQuery::STATUS_ACTIVE); break; case 'allactive': diff --git a/src/applications/project/query/PhabricatorProjectQuery.php b/src/applications/project/query/PhabricatorProjectQuery.php index b1d7e65f45..cb28027046 100644 --- a/src/applications/project/query/PhabricatorProjectQuery.php +++ b/src/applications/project/query/PhabricatorProjectQuery.php @@ -20,7 +20,7 @@ final class PhabricatorProjectQuery { private $ids; private $phids; - private $members; + private $memberPHIDs; private $status = 'status-any'; const STATUS_ANY = 'status-any'; @@ -59,8 +59,8 @@ final class PhabricatorProjectQuery { return $this; } - public function setMembers(array $members) { - $this->members = $members; + public function withMemberPHIDs(array $member_phids) { + $this->memberPHIDs = $member_phids; return $this; } @@ -182,13 +182,13 @@ final class PhabricatorProjectQuery { $affil_table = new PhabricatorProjectAffiliation(); $joins = array(); - if ($this->members) { + if ($this->memberPHIDs) { $joins[] = qsprintf( $conn_r, 'JOIN %T member ON member.projectPHID = p.phid AND member.userPHID in (%Ls)', $affil_table->getTableName(), - $this->members); + $this->memberPHIDs); } return implode(' ', $joins);