Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / tokens / query / PhabricatorTokenReceiverQuery.php
blob2eb8158418b6e911a98513e3e49f88fc7a143a91
1 <?php
3 final class PhabricatorTokenReceiverQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $tokenCounts;
8 protected function loadPage() {
9 $table = new PhabricatorTokenCount();
10 $conn_r = $table->establishConnection('r');
12 $rows = queryfx_all(
13 $conn_r,
14 'SELECT objectPHID, tokenCount FROM %T ORDER BY tokenCount DESC',
15 $table->getTableName());
17 $this->tokenCounts = ipull($rows, 'tokenCount', 'objectPHID');
18 return ipull($rows, 'objectPHID');
21 protected function willFilterPage(array $phids) {
22 $objects = id(new PhabricatorObjectQuery())
23 ->setViewer($this->getViewer())
24 ->withPHIDs($phids)
25 ->execute();
27 // Reorder the objects in the input order.
28 $objects = array_select_keys($objects, $phids);
30 return $objects;
33 public function getTokenCounts() {
34 return $this->tokenCounts;
37 public function getQueryApplicationClass() {
38 return 'PhabricatorTokensApplication';