Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/query/PhabricatorNotificationQuery.php
| Show First 20 Lines • Show All 70 Lines • ▼ Show 20 Lines | protected function loadPage() { | ||||
| foreach ($stories as $key => $story) { | foreach ($stories as $key => $story) { | ||||
| $story->setHasViewed($viewed_map[$key]); | $story->setHasViewed($viewed_map[$key]); | ||||
| } | } | ||||
| return $stories; | return $stories; | ||||
| } | } | ||||
| protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
| $where = array(); | $where = parent::buildWhereClauseParts($conn); | ||||
| if ($this->userPHIDs !== null) { | if ($this->userPHIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'notif.userPHID IN (%Ls)', | 'notif.userPHID IN (%Ls)', | ||||
| $this->userPHIDs); | $this->userPHIDs); | ||||
| } | } | ||||
| if ($this->unread !== null) { | if ($this->unread !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'notif.hasViewed = %d', | 'notif.hasViewed = %d', | ||||
| (int)!$this->unread); | (int)!$this->unread); | ||||
| } | } | ||||
| if ($this->keys) { | if ($this->keys) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn_r, | $conn, | ||||
| 'notif.chronologicalKey IN (%Ls)', | 'notif.chronologicalKey IN (%Ls)', | ||||
| $this->keys); | $this->keys); | ||||
| } | } | ||||
| return $this->formatWhereClause($where); | return $where; | ||||
| } | } | ||||
| protected function getResultCursor($item) { | protected function getResultCursor($item) { | ||||
| return $item->getChronologicalKey(); | return $item->getChronologicalKey(); | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorNotificationsApplication'; | return 'PhabricatorNotificationsApplication'; | ||||
| } | } | ||||
| } | } | ||||