Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/query/PhabricatorProjectQuery.php
<?php | <?php | ||||
final class PhabricatorProjectQuery | final class PhabricatorProjectQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $memberPHIDs; | private $memberPHIDs; | ||||
private $watcherPHIDs; | private $watcherPHIDs; | ||||
private $slugs; | private $slugs; | ||||
private $slugNormals; | private $slugNormals; | ||||
private $slugMap; | private $slugMap; | ||||
private $allSlugs; | private $allSlugs; | ||||
private $names; | private $names; | ||||
private $namePrefixes; | |||||
private $nameTokens; | private $nameTokens; | ||||
private $icons; | private $icons; | ||||
private $colors; | private $colors; | ||||
private $ancestorPHIDs; | private $ancestorPHIDs; | ||||
private $parentPHIDs; | private $parentPHIDs; | ||||
private $isMilestone; | private $isMilestone; | ||||
private $hasSubprojects; | private $hasSubprojects; | ||||
private $minDepth; | private $minDepth; | ||||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Lines | public function withSlugs(array $slugs) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withNames(array $names) { | public function withNames(array $names) { | ||||
$this->names = $names; | $this->names = $names; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withNamePrefixes(array $prefixes) { | |||||
$this->namePrefixes = $prefixes; | |||||
return $this; | |||||
} | |||||
public function withNameTokens(array $tokens) { | public function withNameTokens(array $tokens) { | ||||
$this->nameTokens = array_values($tokens); | $this->nameTokens = array_values($tokens); | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withIcons(array $icons) { | public function withIcons(array $icons) { | ||||
$this->icons = $icons; | $this->icons = $icons; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 370 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->names !== null) { | if ($this->names !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'name IN (%Ls)', | 'name IN (%Ls)', | ||||
$this->names); | $this->names); | ||||
} | } | ||||
if ($this->namePrefixes) { | |||||
$parts = array(); | |||||
foreach ($this->namePrefixes as $name_prefix) { | |||||
$parts[] = qsprintf( | |||||
$conn, | |||||
'name LIKE %>', | |||||
$name_prefix); | |||||
} | |||||
$where[] = '('.implode(' OR ', $parts).')'; | |||||
} | |||||
if ($this->icons !== null) { | if ($this->icons !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'icon IN (%Ls)', | 'icon IN (%Ls)', | ||||
$this->icons); | $this->icons); | ||||
} | } | ||||
if ($this->colors !== null) { | if ($this->colors !== null) { | ||||
▲ Show 20 Lines • Show All 313 Lines • Show Last 20 Lines |