public function PrivateMessageThread::getLastAccessTimestamp in Private Message 8.2
Same name and namespace in other branches
- 8 src/Entity/PrivateMessageThread.php \Drupal\private_message\Entity\PrivateMessageThread::getLastAccessTimestamp()
Get the last access timestamp for the given user.
Parameters
\Drupal\Core\Session\AccountInterface $account: The user whose last access time should be retrieved.
Return value
int The timestamp at which the user last accessed the thread
Overrides PrivateMessageThreadInterface::getLastAccessTimestamp
File
- src/
Entity/ PrivateMessageThread.php, line 159
Class
- PrivateMessageThread
- Defines the Private Message Thread entity.
Namespace
Drupal\private_message\EntityCode
public function getLastAccessTimestamp(AccountInterface $account) {
return \Drupal::database()
->select('pm_thread_history', 'pm_thread_history')
->condition('uid', $account
->id())
->condition('thread_id', $this
->id())
->fields('pm_thread_history', [
'access_timestamp',
])
->execute()
->fetchField();
}