You are here

private function PrivateMessageThread::deleteReferencedEntities in Private Message 8

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

Delete the thread from the database, as well as all reference entities.

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

File

src/Entity/PrivateMessageThread.php, line 444

Class

PrivateMessageThread
Defines the Private Message Thread entity.

Namespace

Drupal\private_message\Entity

Code

private function deleteReferencedEntities() {
  $messages = $this
    ->getMessages();
  foreach ($messages as $message) {
    $message
      ->delete();
  }
  $last_access_times = $this
    ->getLastAccessTimes();
  foreach ($last_access_times as $last_access_time) {
    $last_access_time
      ->delete();
  }
  $last_delete_times = $this
    ->getLastDeleteTimes();
  foreach ($last_delete_times as $last_delete_time) {
    $last_delete_time
      ->delete();
  }
}