Differential D16041 Diff 38608 src/applications/notification/storage/PhabricatorFeedStoryNotification.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/notification/storage/PhabricatorFeedStoryNotification.php
| Show First 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | queryfx( | ||||
| WHERE userPHID = %s | WHERE userPHID = %s | ||||
| AND primaryObjectPHID = %s | AND primaryObjectPHID = %s | ||||
| AND hasViewed = 0', | AND hasViewed = 0', | ||||
| $notification_table->getTableName(), | $notification_table->getTableName(), | ||||
| $user->getPHID(), | $user->getPHID(), | ||||
| $object_phid); | $object_phid); | ||||
| unset($unguarded); | unset($unguarded); | ||||
| } | |||||
| public function countUnread(PhabricatorUser $user) { | |||||
| $conn = $this->establishConnection('r'); | |||||
| $data = queryfx_one( | |||||
| $conn, | |||||
| 'SELECT COUNT(*) as count | |||||
| FROM %T | |||||
| WHERE userPHID = %s AND hasViewed = 0', | |||||
| $this->getTableName(), | |||||
| $user->getPHID()); | |||||
| return $data['count']; | $count_key = PhabricatorUserNotificationCountCacheType::KEY_COUNT; | ||||
| PhabricatorUserCache::clearCache($count_key, $user->getPHID()); | |||||
| $user->clearCacheData($count_key); | |||||
| } | } | ||||
| } | } | ||||