You are here

class PrivateMessageUpdateUnreadThreadCountCommand in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Ajax/PrivateMessageUpdateUnreadThreadCountCommand.php \Drupal\private_message\Ajax\PrivateMessageUpdateUnreadThreadCountCommand

Ajax command to update the number of unread threads.

Hierarchy

Expanded class hierarchy of PrivateMessageUpdateUnreadThreadCountCommand

1 file declares its use of PrivateMessageUpdateUnreadThreadCountCommand
AjaxController.php in src/Controller/AjaxController.php

File

src/Ajax/PrivateMessageUpdateUnreadThreadCountCommand.php, line 10

Namespace

Drupal\private_message\Ajax
View source
class PrivateMessageUpdateUnreadThreadCountCommand implements CommandInterface {

  /**
   * The number of unread threads.
   *
   * @var int
   */
  protected $unreadThreadCount;

  /**
   * Constructs a PrivateMessageMembersAutocompleteResponseCommand object.
   *
   * @param int $unreadThreadCount
   *   The number of unread threads.
   */
  public function __construct($unreadThreadCount) {
    $this->unreadThreadCount = $unreadThreadCount;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    return [
      'command' => 'privateMessageUpdateUnreadThreadCount',
      'unreadThreadCount' => $this->unreadThreadCount,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PrivateMessageUpdateUnreadThreadCountCommand::$unreadThreadCount protected property The number of unread threads.
PrivateMessageUpdateUnreadThreadCountCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
PrivateMessageUpdateUnreadThreadCountCommand::__construct public function Constructs a PrivateMessageMembersAutocompleteResponseCommand object.