Differential D20907 Diff 49851 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 $emailAddress; | private $emailAddresses; | ||||
private $assigneePHIDs; | private $assigneePHIDs; | ||||
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; | ||||
} | } | ||||
public function withPHIDs(array $phids) { | public function withPHIDs(array $phids) { | ||||
$this->phids = $phids; | $this->phids = $phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withIdentityNames(array $names) { | public function withIdentityNames(array $names) { | ||||
$this->identityNames = $names; | $this->identityNames = $names; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withIdentityNameLike($name_like) { | public function withIdentityNameLike($name_like) { | ||||
$this->identityNameLike = $name_like; | $this->identityNameLike = $name_like; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withEmailAddress($address) { | public function withEmailAddresses(array $addresses) { | ||||
$this->emailAddress = $address; | $this->emailAddresses = $addresses; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withAssigneePHIDs(array $assignees) { | public function withAssigneePHIDs(array $assignees) { | ||||
$this->assigneePHIDs = $assignees; | $this->assigneePHIDs = $assignees; | ||||
return $this; | return $this; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | if ($this->identityNames !== null) { | ||||
} | } | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'repository_identity.identityNameHash IN (%Ls)', | 'repository_identity.identityNameHash IN (%Ls)', | ||||
$name_hashes); | $name_hashes); | ||||
} | } | ||||
if ($this->emailAddress !== null) { | if ($this->emailAddresses !== null) { | ||||
$identity_style = "<{$this->emailAddress}>"; | |||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'repository_identity.identityNameRaw LIKE %<', | 'repository_identity.emailAddress IN (%Ls)', | ||||
$identity_style); | $this->emailAddresses); | ||||
} | } | ||||
if ($this->identityNameLike != null) { | if ($this->identityNameLike != null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'repository_identity.identityNameRaw LIKE %~', | 'repository_identity.identityNameRaw LIKE %~', | ||||
$this->identityNameLike); | $this->identityNameLike); | ||||
} | } | ||||
Show All 9 Lines |