mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-23 13:08:18 +01:00
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
This commit is contained in:
parent
d25d9ddb01
commit
b0fda3be25
7 changed files with 14 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -73,13 +73,12 @@ 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(
|
||||
return id(new PhabricatorOwnersOwner())->loadAllWhere(
|
||||
'userPHID in (%Ls)',
|
||||
$phids);
|
||||
}
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue