Differential D19789 Diff 47303 src/applications/calendar/query/PhabricatorCalendarEventInviteeQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/query/PhabricatorCalendarEventInviteeQuery.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | $data = queryfx_all( | ||||
$table->getTableName(), | $table->getTableName(), | ||||
$this->buildWhereClause($conn_r), | $this->buildWhereClause($conn_r), | ||||
$this->buildOrderClause($conn_r), | $this->buildOrderClause($conn_r), | ||||
$this->buildLimitClause($conn_r)); | $this->buildLimitClause($conn_r)); | ||||
return $table->loadAllFromArray($data); | return $table->loadAllFromArray($data); | ||||
} | } | ||||
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->eventPHIDs !== null) { | if ($this->eventPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'eventPHID IN (%Ls)', | 'eventPHID IN (%Ls)', | ||||
$this->eventPHIDs); | $this->eventPHIDs); | ||||
} | } | ||||
if ($this->inviteePHIDs !== null) { | if ($this->inviteePHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'inviteePHID IN (%Ls)', | 'inviteePHID IN (%Ls)', | ||||
$this->inviteePHIDs); | $this->inviteePHIDs); | ||||
} | } | ||||
if ($this->inviterPHIDs !== null) { | if ($this->inviterPHIDs !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'inviterPHID IN (%Ls)', | 'inviterPHID IN (%Ls)', | ||||
$this->inviterPHIDs); | $this->inviterPHIDs); | ||||
} | } | ||||
if ($this->statuses !== null) { | if ($this->statuses !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'status = %d', | 'status = %d', | ||||
$this->statuses); | $this->statuses); | ||||
} | } | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorCalendarApplication'; | return 'PhabricatorCalendarApplication'; | ||||
} | } | ||||
} | } |