You are here

class PrivateMessageInsertThreadCommand in Private Message 8

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

Ajax command to insert a thread into the private message page.

Hierarchy

Expanded class hierarchy of PrivateMessageInsertThreadCommand

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

File

src/Ajax/PrivateMessageInsertThreadCommand.php, line 10

Namespace

Drupal\private_message\Ajax
View source
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,
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PrivateMessageInsertThreadCommand::$thread protected property The HTML of the thread to be inserted.
PrivateMessageInsertThreadCommand::render public function Return an array to be run through json_encode and sent to the client. Overrides CommandInterface::render
PrivateMessageInsertThreadCommand::__construct public function Constructs a PrivateMessageInsertThreadCommand object.