Path: blob/master/src/applications/auth/query/PhabricatorAuthMessageQuery.php
12256 views
<?php12final class PhabricatorAuthMessageQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $ids;6private $phids;7private $messageKeys;89public function withIDs(array $ids) {10$this->ids = $ids;11return $this;12}1314public function withPHIDs(array $phids) {15$this->phids = $phids;16return $this;17}1819public function withMessageKeys(array $keys) {20$this->messageKeys = $keys;21return $this;22}2324public function newResultObject() {25return new PhabricatorAuthMessage();26}2728protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {29$where = parent::buildWhereClauseParts($conn);3031if ($this->ids !== null) {32$where[] = qsprintf(33$conn,34'id IN (%Ld)',35$this->ids);36}3738if ($this->phids !== null) {39$where[] = qsprintf(40$conn,41'phid IN (%Ls)',42$this->phids);43}4445if ($this->messageKeys !== null) {46$where[] = qsprintf(47$conn,48'messageKey IN (%Ls)',49$this->messageKeys);50}5152return $where;53}5455protected function willFilterPage(array $messages) {56$message_types = PhabricatorAuthMessageType::getAllMessageTypes();5758foreach ($messages as $key => $message) {59$message_key = $message->getMessageKey();6061$message_type = idx($message_types, $message_key);62if (!$message_type) {63unset($messages[$key]);64$this->didRejectResult($message);65continue;66}6768$message->attachMessageType($message_type);69}7071return $messages;72}7374public function getQueryApplicationClass() {75return 'PhabricatorAuthApplication';76}7778}798081