You are here

public function PrivateMessageThread::getLastDeleteTime in Private Message 8

Get the last delete time object for the given user.

Parameters

\Drupal\Core\Session\AccountInterface $account: The user whose last delete time should be retrieved.

Return value

bool|\Drupal\private_message\Entity\PrivateMessageThreadDeleteTimeInterface

Overrides PrivateMessageThreadInterface::getLastDeleteTime

1 call to PrivateMessageThread::getLastDeleteTime()
PrivateMessageThread::updateLastDeleteTime in src/Entity/PrivateMessageThread.php
Update the last delete time for the given user.

File

src/Entity/PrivateMessageThread.php, line 234

Class

PrivateMessageThread
Defines the Private Message Thread entity.

Namespace

Drupal\private_message\Entity

Code

public function getLastDeleteTime(AccountInterface $account) {
  foreach ($this
    ->get('last_delete_time') as $last_delete_time) {
    if ($last_delete_time->entity
      ->getOwnerId() == $account
      ->id()) {
      return $last_delete_time->entity;
    }
  }
  return FALSE;
}