You are here

public function PrivateMessageServiceInterface::getUpdatedInboxThreads in Private Message 8.2

Same name and namespace in other branches
  1. 8 src/Service/PrivateMessageServiceInterface.php \Drupal\private_message\Service\PrivateMessageServiceInterface::getUpdatedInboxThreads()

Retrieve inbox information for the current user.

If $existingThreadIds is provided it means that the inbox already has threads in it. Any threads that have changed since the provided last update time, as well as any new threads that have been updated since the oldest provided updated time, will be returned. If $existingThreadIds is not provided it means the inbox is empty, so a maximum of $count number of threads is instead returned.

Parameters

array $existingThreadIds: An array of private message thread last update times, keyed by thread ID.

int $count: The number of threads to return if no existing thread IDs were provided.

Return value

array An array containing the following keys:

  • thread_ids: The IDs of any threads in the inbox, in the order in which they should appear in the inbox. This array will be used to (re) order inbox items
  • new_threads: An array of \Drupal\private_message\Entity\PrivateMessageThread objects for any threads that either don't exist in the DOM at the time of the request, or do exist but have been updated.
1 method overrides PrivateMessageServiceInterface::getUpdatedInboxThreads()
PrivateMessageService::getUpdatedInboxThreads in src/Service/PrivateMessageService.php
Retrieve inbox information for the current user.

File

src/Service/PrivateMessageServiceInterface.php, line 146

Class

PrivateMessageServiceInterface
The interface for the Private Message Service.

Namespace

Drupal\private_message\Service

Code

public function getUpdatedInboxThreads(array $existingThreadIds, $count = FALSE);