You are here

class PrivateMessageInboxInsertThreadsCommand in Private Message 8.2

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

Ajax Command to insert private message inbox threads.

Hierarchy

Expanded class hierarchy of PrivateMessageInboxInsertThreadsCommand

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

File

src/Ajax/PrivateMessageInboxInsertThreadsCommand.php, line 10

Namespace

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

  /**
   * The HTML for the threads to be inserted in the page.
   *
   * @var string
   */
  protected $threads;

  /**
   * Boolean to determine if there are more threads to come.
   *
   * @var bool
   */
  protected $hasNext;

  /**
   * Constructs a PrivateMessageInboxInsertThreadsCommand object.
   *
   * @param string $threads
   *   The HTML for the threads to be inserted in the page.
   * @param bool $has_next
   *   A boolean to know if there are more threads after.
   */
  public function __construct($threads, $has_next) {
    $this->threads = $threads;
    $this->hasNext = $has_next;
  }

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

}

Members

Namesort descending Modifiers Type Description Overrides
PrivateMessageInboxInsertThreadsCommand::$hasNext protected property Boolean to determine if there are more threads to come.
PrivateMessageInboxInsertThreadsCommand::$threads protected property The HTML for the threads to be inserted in the page.
PrivateMessageInboxInsertThreadsCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
PrivateMessageInboxInsertThreadsCommand::__construct public function Constructs a PrivateMessageInboxInsertThreadsCommand object.