Changeset View
Changeset View
Standalone View
Standalone View
src/applications/nuance/query/NuanceItemQuery.php
<?php | <?php | ||||
final class NuanceItemQuery | final class NuanceItemQuery | ||||
extends NuanceQuery { | extends NuanceQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $sourcePHIDs; | private $sourcePHIDs; | ||||
private $itemTypes; | |||||
private $itemKeys; | |||||
private $containerKeys; | |||||
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 withSourcePHIDs(array $source_phids) { | public function withSourcePHIDs(array $source_phids) { | ||||
$this->sourcePHIDs = $source_phids; | $this->sourcePHIDs = $source_phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withItemTypes(array $item_types) { | |||||
$this->itemTypes = $item_types; | |||||
return $this; | |||||
} | |||||
public function withItemKeys(array $item_keys) { | |||||
$this->itemKeys = $item_keys; | |||||
return $this; | |||||
} | |||||
public function withItemContainerKeys(array $container_keys) { | |||||
$this->containerKeys = $container_keys; | |||||
return $this; | |||||
} | |||||
public function newResultObject() { | public function newResultObject() { | ||||
return new NuanceItem(); | return new NuanceItem(); | ||||
} | } | ||||
protected function loadPage() { | protected function loadPage() { | ||||
return $this->loadStandardPage($this->newResultObject()); | return $this->loadStandardPage($this->newResultObject()); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->phids !== null) { | if ($this->phids !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'phid IN (%Ls)', | 'phid IN (%Ls)', | ||||
$this->phids); | $this->phids); | ||||
} | } | ||||
if ($this->itemTypes !== null) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'itemType IN (%Ls)', | |||||
$this->itemTypes); | |||||
} | |||||
if ($this->itemKeys !== null) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'itemKey IN (%Ls)', | |||||
$this->itemKeys); | |||||
} | |||||
if ($this->containerKeys !== null) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'itemContainerKey IN (%Ls)', | |||||
$this->containerKeys); | |||||
} | |||||
return $where; | return $where; | ||||
} | } | ||||
} | } |