Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conpherence/query/ConpherenceThreadQuery.php
<?php | <?php | ||||
final class ConpherenceThreadQuery | final class ConpherenceThreadQuery | ||||
extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
const TRANSACTION_LIMIT = 100; | const TRANSACTION_LIMIT = 100; | ||||
private $phids; | private $phids; | ||||
private $ids; | private $ids; | ||||
private $participantPHIDs; | private $participantPHIDs; | ||||
private $isRoom; | private $isRoom; | ||||
private $needParticipants; | |||||
private $needWidgetData; | private $needWidgetData; | ||||
private $needTransactions; | private $needTransactions; | ||||
private $needParticipantCache; | private $needParticipantCache; | ||||
private $needFilePHIDs; | private $needFilePHIDs; | ||||
private $afterTransactionID; | private $afterTransactionID; | ||||
private $beforeTransactionID; | private $beforeTransactionID; | ||||
private $transactionLimit; | private $transactionLimit; | ||||
public function needFilePHIDs($need_file_phids) { | public function needFilePHIDs($need_file_phids) { | ||||
$this->needFilePHIDs = $need_file_phids; | $this->needFilePHIDs = $need_file_phids; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function needParticipantCache($participant_cache) { | public function needParticipantCache($participant_cache) { | ||||
$this->needParticipantCache = $participant_cache; | $this->needParticipantCache = $participant_cache; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function needParticipants($need) { | |||||
$this->needParticipants = $need; | |||||
return $this; | |||||
} | |||||
public function needWidgetData($need_widget_data) { | public function needWidgetData($need_widget_data) { | ||||
$this->needWidgetData = $need_widget_data; | $this->needWidgetData = $need_widget_data; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function needTransactions($need_transactions) { | public function needTransactions($need_transactions) { | ||||
$this->needTransactions = $need_transactions; | $this->needTransactions = $need_transactions; | ||||
return $this; | return $this; | ||||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | protected function loadPage() { | ||||
$conpherences = $table->loadAllFromArray($data); | $conpherences = $table->loadAllFromArray($data); | ||||
if ($conpherences) { | if ($conpherences) { | ||||
$conpherences = mpull($conpherences, null, 'getPHID'); | $conpherences = mpull($conpherences, null, 'getPHID'); | ||||
$this->loadParticipantsAndInitHandles($conpherences); | $this->loadParticipantsAndInitHandles($conpherences); | ||||
if ($this->needParticipantCache) { | if ($this->needParticipantCache) { | ||||
$this->loadCoreHandles($conpherences, 'getRecentParticipantPHIDs'); | $this->loadCoreHandles($conpherences, 'getRecentParticipantPHIDs'); | ||||
} | } | ||||
if ($this->needWidgetData) { | if ($this->needWidgetData || $this->needParticipants) { | ||||
$this->loadCoreHandles($conpherences, 'getParticipantPHIDs'); | $this->loadCoreHandles($conpherences, 'getParticipantPHIDs'); | ||||
} | } | ||||
if ($this->needTransactions) { | if ($this->needTransactions) { | ||||
$this->loadTransactionsAndHandles($conpherences); | $this->loadTransactionsAndHandles($conpherences); | ||||
} | } | ||||
if ($this->needFilePHIDs || $this->needWidgetData) { | if ($this->needFilePHIDs || $this->needWidgetData) { | ||||
$this->loadFilePHIDs($conpherences); | $this->loadFilePHIDs($conpherences); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 268 Lines • Show Last 20 Lines |