Changeset View
Changeset View
Standalone View
Standalone View
src/applications/daemon/query/PhabricatorDaemonLogQuery.php
| Show First 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | foreach ($daemons as $key => $daemon) { | ||||
| unset($daemons[$key]); | unset($daemons[$key]); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| return $daemons; | return $daemons; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = array(); | ||||
| if ($this->ids !== null) { | if ($this->ids !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'id IN (%Ld)', | 'id IN (%Ld)', | ||||
| $this->ids); | $this->ids); | ||||
| } | } | ||||
| if ($this->notIDs !== null) { | if ($this->notIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'id NOT IN (%Ld)', | 'id NOT IN (%Ld)', | ||||
| $this->notIDs); | $this->notIDs); | ||||
| } | } | ||||
| if ($this->getStatusConstants()) { | if ($this->getStatusConstants()) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'status IN (%Ls)', | 'status IN (%Ls)', | ||||
| $this->getStatusConstants()); | $this->getStatusConstants()); | ||||
| } | } | ||||
| if ($this->daemonClasses !== null) { | if ($this->daemonClasses !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'daemon IN (%Ls)', | 'daemon IN (%Ls)', | ||||
| $this->daemonClasses); | $this->daemonClasses); | ||||
| } | } | ||||
| if ($this->daemonIDs !== null) { | if ($this->daemonIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'daemonID IN (%Ls)', | 'daemonID IN (%Ls)', | ||||
| $this->daemonIDs); | $this->daemonIDs); | ||||
| } | } | ||||
| $where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
| return $this->formatWhereClause($where); | |||||
| return $this->formatWhereClause($conn, $where); | |||||
| } | } | ||||
| private function getStatusConstants() { | private function getStatusConstants() { | ||||
| $status = $this->status; | $status = $this->status; | ||||
| switch ($status) { | switch ($status) { | ||||
| case self::STATUS_ALL: | case self::STATUS_ALL: | ||||
| return array(); | return array(); | ||||
| case self::STATUS_RUNNING: | case self::STATUS_RUNNING: | ||||
| Show All 20 Lines | |||||