You are here

public function PrivateMessageThread::getMessages in Private Message 8

Same name and namespace in other branches
  1. 8.2 src/Entity/PrivateMessageThread.php \Drupal\private_message\Entity\PrivateMessageThread::getMessages()

Retrieve all private messages attached to this thread.

Return value

\Drupal\Core\Field\EntityReferenceFieldItemListInterface A list of private messages attached to this thread

Overrides PrivateMessageThreadInterface::getMessages

4 calls to PrivateMessageThread::getMessages()
PrivateMessageThread::deleteReferencedEntities in src/Entity/PrivateMessageThread.php
Delete the thread from the database, as well as all reference entities.
PrivateMessageThread::filterNewestMessages in src/Entity/PrivateMessageThread.php
Filter the list down to only the newest messages.
PrivateMessageThread::filterUserDeletedMessages in src/Entity/PrivateMessageThread.php
Filter messages in the thread deleted by the given account.
PrivateMessageThread::getNewestMessageCreationTimestamp in src/Entity/PrivateMessageThread.php
Get the created timestamp of the newest private message in the thread.

File

src/Entity/PrivateMessageThread.php, line 104

Class

PrivateMessageThread
Defines the Private Message Thread entity.

Namespace

Drupal\private_message\Entity

Code

public function getMessages() {
  return $this
    ->get('private_messages')
    ->referencedEntities();
}