Changeset View
Changeset View
Standalone View
Standalone View
src/applications/chatlog/query/PhabricatorChatLogQuery.php
- This file was moved from src/applications/chatlog/PhabricatorChatLogQuery.php.
Show All 27 Lines | $data = queryfx_all( | ||||
$this->buildOrderClause($conn_r), | $this->buildOrderClause($conn_r), | ||||
$this->buildLimitClause($conn_r)); | $this->buildLimitClause($conn_r)); | ||||
$logs = $table->loadAllFromArray($data); | $logs = $table->loadAllFromArray($data); | ||||
return $logs; | return $logs; | ||||
} | } | ||||
public function willFilterPage(array $events) { | |||||
$channel_ids = mpull($events, 'getChannelID', 'getChannelID'); | |||||
$channels = id(new PhabricatorChatLogChannelQuery()) | |||||
->setViewer($this->getViewer()) | |||||
->withIDs($channel_ids) | |||||
->execute(); | |||||
$channels = mpull($channels, null, 'getID'); | |||||
foreach ($events as $key => $event) { | |||||
$channel = idx($channels, $event->getChannelID()); | |||||
if (!$channel) { | |||||
unset($events[$key]); | |||||
continue; | |||||
} | |||||
$event->attachChannel($channel); | |||||
} | |||||
return $events; | |||||
} | |||||
private function buildWhereClause($conn_r) { | private function buildWhereClause($conn_r) { | ||||
$where = array(); | $where = array(); | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn_r); | ||||
if ($this->maximumEpoch) { | if ($this->maximumEpoch) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn_r, | ||||
Show All 19 Lines |