You are here

class PrivateMessageInsertPreviousMessagesCommand in Private Message 8.2

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

Class to insert older private messages into a private message thread.

Hierarchy

Expanded class hierarchy of PrivateMessageInsertPreviousMessagesCommand

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

File

src/Ajax/PrivateMessageInsertPreviousMessagesCommand.php, line 8

Namespace

Drupal\private_message\Ajax
View source
class PrivateMessageInsertPreviousMessagesCommand extends PrivateMessageInsertMessagesCommand {

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

  /**
   * Constructs a PrivateMessageInsertPreviousMessagesCommand object.
   *
   * @param string $messages
   *   The HTML for the messages to be inserted in the page.
   * @param int $messagesCount
   *   The number of messages.
   * @param bool $has_next
   *   A boolean to know if there are more messages after.
   */
  public function __construct($messages, $messagesCount, $has_next) {
    parent::__construct('previous', $messages, $messagesCount);
    $this->hasNext = $has_next;
  }

  /**
   * {@inheritdoc}
   */
  public function render() {
    $return = parent::render();
    $return['hasNext'] = $this->hasNext;
    return $return;
  }

}

Members

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