You are here

protected function AjaxController::getNewUnreadThreadCount in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Controller/AjaxController.php \Drupal\private_message\Controller\AjaxController::getNewUnreadThreadCount()

Create Ajax Command returning the number of unread private message threads.

Only messages created since the current user last visited the private message page are shown.

Parameters

Drupal\Core\Ajax\AjaxResponse $response: The response to which any commands should be attached.

1 call to AjaxController::getNewUnreadThreadCount()
AjaxController::ajaxCallback in src/Controller/AjaxController.php
Create AJAX responses for JavaScript requests.

File

src/Controller/AjaxController.php, line 332

Class

AjaxController
Controller to handle Ajax requests.

Namespace

Drupal\private_message\Controller

Code

protected function getNewUnreadThreadCount(AjaxResponse $response) {
  $unread_thread_count = $this->privateMessageService
    ->getUnreadThreadCount();
  $response
    ->addCommand(new PrivateMessageUpdateUnreadThreadCountCommand($unread_thread_count));
}