public function SocialPrivateMessageService::getLastMessagesFromOtherUsers in Open Social 8.8
Same name and namespace in other branches
- 8.9 modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 8.3 modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 8.4 modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 8.5 modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 8.6 modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 8.7 modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 10.3.x modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 10.0.x modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 10.1.x modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- 10.2.x modules/social_features/social_private_message/src/Service/SocialPrivateMessageService.php \Drupal\social_private_message\Service\SocialPrivateMessageService::getLastMessagesFromOtherUsers()
Retrieves times of last message in all threads send by other users.
Parameters
int $uid: The user uid to check for.
array $threads: List of thread IDs to che check for.
Return value
array A list of timestamps linked to the thread IDs.
1 call to SocialPrivateMessageService::getLastMessagesFromOtherUsers()
- SocialPrivateMessageService::updateUnreadCount in modules/
social_features/ social_private_message/ src/ Service/ SocialPrivateMessageService.php - Update the unread thread count.
File
- modules/
social_features/ social_private_message/ src/ Service/ SocialPrivateMessageService.php, line 141
Class
- SocialPrivateMessageService
- Class SocialPrivateMessageService.
Namespace
Drupal\social_private_message\ServiceCode
public function getLastMessagesFromOtherUsers($uid, array $threads) {
return $this->database
->query('SELECT MAX(pm.created), pmt.entity_id ' . 'FROM {private_message_thread__private_messages} pmt ' . 'LEFT JOIN {private_messages} pm ON pmt.private_messages_target_id = pm.id ' . 'WHERE pmt.entity_id IN (:threads[]) AND pm.owner <> :uid ' . 'GROUP BY pmt.entity_id', [
':threads[]' => $threads,
':uid' => $uid,
])
->fetchAllKeyed(1, 0);
}