Changeset View
Changeset View
Standalone View
Standalone View
src/applications/owners/query/PhabricatorOwnersPackageQuery.php
<?php | <?php | ||||
final class PhabricatorOwnersPackageQuery | final class PhabricatorOwnersPackageQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $ownerPHIDs; | private $ownerPHIDs; | ||||
private $authorityPHIDs; | private $authorityPHIDs; | ||||
private $repositoryPHIDs; | private $repositoryPHIDs; | ||||
private $paths; | private $paths; | ||||
private $statuses; | private $statuses; | ||||
private $authorityModes; | |||||
private $controlMap = array(); | private $controlMap = array(); | ||||
private $controlResults; | private $controlResults; | ||||
private $needPaths; | private $needPaths; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | public function withControl($repository_phid, array $paths) { | ||||
} | } | ||||
// We need to load paths to execute control queries. | // We need to load paths to execute control queries. | ||||
$this->needPaths = true; | $this->needPaths = true; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withAuthorityModes(array $modes) { | |||||
$this->authorityModes = $modes; | |||||
return $this; | |||||
} | |||||
public function withNameNgrams($ngrams) { | public function withNameNgrams($ngrams) { | ||||
return $this->withNgramsConstraint( | return $this->withNgramsConstraint( | ||||
new PhabricatorOwnersPackageNameNgrams(), | new PhabricatorOwnersPackageNameNgrams(), | ||||
$ngrams); | $ngrams); | ||||
} | } | ||||
public function needPaths($need_paths) { | public function needPaths($need_paths) { | ||||
$this->needPaths = $need_paths; | $this->needPaths = $need_paths; | ||||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Lines | if ($this->controlMap) { | ||||
$conn, | $conn, | ||||
'(rpath.repositoryPHID = %s AND rpath.pathIndex IN (%Ls))', | '(rpath.repositoryPHID = %s AND rpath.pathIndex IN (%Ls))', | ||||
$repository_phid, | $repository_phid, | ||||
$indexes); | $indexes); | ||||
} | } | ||||
$where[] = qsprintf($conn, '%LO', $clauses); | $where[] = qsprintf($conn, '%LO', $clauses); | ||||
} | } | ||||
if ($this->authorityModes !== null) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'authorityMode IN (%Ls)', | |||||
$this->authorityModes); | |||||
} | |||||
return $where; | return $where; | ||||
} | } | ||||
protected function shouldGroupQueryResultRows() { | protected function shouldGroupQueryResultRows() { | ||||
if ($this->shouldJoinOwnersTable()) { | if ($this->shouldJoinOwnersTable()) { | ||||
return true; | return true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |