You are here

PrivateMessageInsertThreadCommand.php in Private Message 8.2

Same filename and directory in other branches
  1. 8 src/Ajax/PrivateMessageInsertThreadCommand.php

File

src/Ajax/PrivateMessageInsertThreadCommand.php
View source
<?php

namespace Drupal\private_message\Ajax;

use Drupal\Core\Ajax\CommandInterface;

/**
 * Ajax command to insert a thread into the private message page.
 */
class PrivateMessageInsertThreadCommand implements CommandInterface {

  /**
   * The HTML of the thread to be inserted.
   *
   * @var string
   */
  protected $thread;

  /**
   * Constructs a PrivateMessageInsertThreadCommand object.
   *
   * @param string $thread
   *   The HTML of the thread to be inserted.
   */
  public function __construct($thread) {
    $this->thread = $thread;
  }

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

}

Classes

Namesort descending Description
PrivateMessageInsertThreadCommand Ajax command to insert a thread into the private message page.