Changeset View
Changeset View
Standalone View
Standalone View
src/applications/almanac/query/AlmanacServiceQuery.php
<?php | <?php | ||||
final class AlmanacServiceQuery | final class AlmanacServiceQuery | ||||
extends AlmanacQuery { | extends AlmanacQuery { | ||||
private $ids; | private $ids; | ||||
private $phids; | private $phids; | ||||
private $names; | private $names; | ||||
private $serviceClasses; | private $serviceClasses; | ||||
private $devicePHIDs; | private $devicePHIDs; | ||||
private $locked; | |||||
private $namePrefix; | private $namePrefix; | ||||
private $nameSuffix; | private $nameSuffix; | ||||
private $needBindings; | private $needBindings; | ||||
public function withIDs(array $ids) { | public function withIDs(array $ids) { | ||||
$this->ids = $ids; | $this->ids = $ids; | ||||
return $this; | return $this; | ||||
Show All 14 Lines | public function withServiceClasses(array $classes) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withDevicePHIDs(array $phids) { | public function withDevicePHIDs(array $phids) { | ||||
$this->devicePHIDs = $phids; | $this->devicePHIDs = $phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withLocked($locked) { | |||||
$this->locked = $locked; | |||||
return $this; | |||||
} | |||||
public function withNamePrefix($prefix) { | public function withNamePrefix($prefix) { | ||||
$this->namePrefix = $prefix; | $this->namePrefix = $prefix; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function withNameSuffix($suffix) { | public function withNameSuffix($suffix) { | ||||
$this->nameSuffix = $suffix; | $this->nameSuffix = $suffix; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
if ($this->devicePHIDs !== null) { | if ($this->devicePHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'binding.devicePHID IN (%Ls)', | 'binding.devicePHID IN (%Ls)', | ||||
$this->devicePHIDs); | $this->devicePHIDs); | ||||
} | } | ||||
if ($this->locked !== null) { | |||||
$where[] = qsprintf( | |||||
$conn, | |||||
'service.isLocked = %d', | |||||
(int)$this->locked); | |||||
} | |||||
if ($this->namePrefix !== null) { | if ($this->namePrefix !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn, | $conn, | ||||
'service.name LIKE %>', | 'service.name LIKE %>', | ||||
$this->namePrefix); | $this->namePrefix); | ||||
} | } | ||||
if ($this->nameSuffix !== null) { | if ($this->nameSuffix !== null) { | ||||
▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines |