Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
1.8 kB · 82 lines
PHP
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283<?php
/** * @extends PhabricatorCursorPagedPolicyAwareQuery<PhabricatorAuthMessage> */final class PhabricatorAuthMessageQuery extends PhabricatorCursorPagedPolicyAwareQuery {
private $ids; private $phids; private $messageKeys;
public function withIDs(array $ids) { $this->ids = $ids; return $this; }
public function withPHIDs(array $phids) { $this->phids = $phids; return $this; }
public function withMessageKeys(array $keys) { $this->messageKeys = $keys; return $this; }
public function newResultObject() { return new PhabricatorAuthMessage(); }
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { $where = parent::buildWhereClauseParts($conn);
if ($this->ids !== null) { $where[] = qsprintf( $conn, 'id IN (%Ld)', $this->ids); }
if ($this->phids !== null) { $where[] = qsprintf( $conn, 'phid IN (%Ls)', $this->phids); }
if ($this->messageKeys !== null) { $where[] = qsprintf( $conn, 'messageKey IN (%Ls)', $this->messageKeys); }
return $where; }
protected function willFilterPage(array $messages) { $message_types = PhabricatorAuthMessageType::getAllMessageTypes();
foreach ($messages as $key => $message) { $message_key = $message->getMessageKey();
$message_type = idx($message_types, $message_key); if (!$message_type) { unset($messages[$key]); $this->didRejectResult($message); continue; }
$message->attachMessageType($message_type); }
return $messages; }
public function getQueryApplicationClass() { return PhabricatorAuthApplication::class; }
}