Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/query/DrydockLeaseQuery.php
<?php | <?php | ||||
final class DrydockLeaseQuery extends DrydockQuery { | final class DrydockLeaseQuery extends DrydockQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $resourcePHIDs; | private $resourcePHIDs; | ||||
private $ownerPHIDs; | |||||
private $statuses; | private $statuses; | ||||
private $datasourceQuery; | private $datasourceQuery; | ||||
private $needUnconsumedCommands; | private $needUnconsumedCommands; | ||||
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 withResourcePHIDs(array $phids) { | public function withResourcePHIDs(array $phids) { | ||||
$this->resourcePHIDs = $phids; | $this->resourcePHIDs = $phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withOwnerPHIDs(array $phids) { | |||||
$this->ownerPHIDs = $phids; | |||||
return $this; | |||||
} | |||||
public function withStatuses(array $statuses) { | public function withStatuses(array $statuses) { | ||||
$this->statuses = $statuses; | $this->statuses = $statuses; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withDatasourceQuery($query) { | public function withDatasourceQuery($query) { | ||||
$this->datasourceQuery = $query; | $this->datasourceQuery = $query; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->resourcePHIDs !== null) { | if ($this->resourcePHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'resourcePHID IN (%Ls)', | 'resourcePHID IN (%Ls)', | ||||
$this->resourcePHIDs); | $this->resourcePHIDs); | ||||
} | } | ||||
if ($this->ownerPHIDs !== null) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'ownerPHID IN (%Ls)', | |||||
$this->ownerPHIDs); | |||||
} | |||||
if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'id IN (%Ld)', | 'id IN (%Ld)', | ||||
$this->ids); | $this->ids); | ||||
} | } | ||||
if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
Show All 24 Lines |