Differential D20908 Diff 49852 src/applications/repository/query/PhabricatorRepositoryIdentityQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/query/PhabricatorRepositoryIdentityQuery.php
<?php | <?php | ||||
final class PhabricatorRepositoryIdentityQuery | final class PhabricatorRepositoryIdentityQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $identityNames; | private $identityNames; | ||||
private $emailAddresses; | private $emailAddresses; | ||||
private $assigneePHIDs; | private $assignedPHIDs; | ||||
private $effectivePHIDs; | |||||
private $identityNameLike; | private $identityNameLike; | ||||
private $hasEffectivePHID; | private $hasEffectivePHID; | ||||
public function withIDs(array $ids) { | public function withIDs(array $ids) { | ||||
$this->ids = $ids; | $this->ids = $ids; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 12 Lines | public function withIdentityNameLike($name_like) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withEmailAddresses(array $addresses) { | public function withEmailAddresses(array $addresses) { | ||||
$this->emailAddresses = $addresses; | $this->emailAddresses = $addresses; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withAssigneePHIDs(array $assignees) { | public function withAssignedPHIDs(array $assigned) { | ||||
$this->assigneePHIDs = $assignees; | $this->assignedPHIDs = $assigned; | ||||
return $this; | |||||
} | |||||
public function withEffectivePHIDs(array $effective) { | |||||
$this->effectivePHIDs = $effective; | |||||
return $this; | return $this; | ||||
} | } | ||||
public function withHasEffectivePHID($has_effective_phid) { | public function withHasEffectivePHID($has_effective_phid) { | ||||
$this->hasEffectivePHID = $has_effective_phid; | $this->hasEffectivePHID = $has_effective_phid; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 21 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'repository_identity.phid IN (%Ls)', | 'repository_identity.phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->assigneePHIDs !== null) { | if ($this->assignedPHIDs !== null) { | ||||
$where[] = qsprintf( | |||||
$conn, | |||||
'repository_identity.manuallySetUserPHID IN (%Ls)', | |||||
$this->assignedPHIDs); | |||||
} | |||||
if ($this->effectivePHIDs !== null) { | |||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'repository_identity.currentEffectiveUserPHID IN (%Ls)', | 'repository_identity.currentEffectiveUserPHID IN (%Ls)', | ||||
$this->assigneePHIDs); | $this->effectivePHIDs); | ||||
} | } | ||||
if ($this->hasEffectivePHID !== null) { | if ($this->hasEffectivePHID !== null) { | ||||
if ($this->hasEffectivePHID) { | if ($this->hasEffectivePHID) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'repository_identity.currentEffectiveUserPHID IS NOT NULL'); | 'repository_identity.currentEffectiveUserPHID IS NOT NULL'); | ||||
} else { | } else { | ||||
Show All 40 Lines |