You are here

public function PrivateMessageThread::updateLastDeleteTime in Private Message 8.2

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

Update the last delete time for the given user.

Parameters

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

Overrides PrivateMessageThreadInterface::updateLastDeleteTime

1 call to PrivateMessageThread::updateLastDeleteTime()
PrivateMessageThread::delete in src/Entity/PrivateMessageThread.php
Deletes an entity permanently.

File

src/Entity/PrivateMessageThread.php, line 195

Class

PrivateMessageThread
Defines the Private Message Thread entity.

Namespace

Drupal\private_message\Entity

Code

public function updateLastDeleteTime(AccountInterface $account) {
  \Drupal::database()
    ->update('pm_thread_history')
    ->condition('uid', $account
    ->id())
    ->condition('thread_id', $this
    ->id())
    ->fields([
    'delete_timestamp' => \Drupal::time()
      ->getRequestTime(),
  ])
    ->execute();
  return $this;
}