Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/query/DrydockResourceQuery.php
<?php | <?php | ||||
final class DrydockResourceQuery | final class DrydockResourceQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | |||||
private $statuses; | private $statuses; | ||||
private $types; | private $types; | ||||
private $blueprintPHIDs; | private $blueprintPHIDs; | ||||
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) { | |||||
$this->phids = $phids; | |||||
return $this; | |||||
} | |||||
public function withTypes(array $types) { | public function withTypes(array $types) { | ||||
$this->types = $types; | $this->types = $types; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withStatuses(array $statuses) { | public function withStatuses(array $statuses) { | ||||
$this->statuses = $statuses; | $this->statuses = $statuses; | ||||
return $this; | return $this; | ||||
Show All 26 Lines | private function buildWhereClause(AphrontDatabaseConnection $conn_r) { | ||||
if ($this->ids) { | if ($this->ids) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'id IN (%Ld)', | 'id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'phid IN (%Ls)', | |||||
$this->phids); | |||||
} | |||||
if ($this->types) { | if ($this->types) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
'type IN (%Ls)', | 'type IN (%Ls)', | ||||
$this->types); | $this->types); | ||||
} | } | ||||
if ($this->statuses) { | if ($this->statuses) { | ||||
Show All 23 Lines |