You are here

public function PrivateMessageThreadInterface::delete in Private Message 8

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

Perform a delete action on the private message thread.

When this method is called, the following process happens:

  • If no user has been provided, the thread is deleted outright. Otherwise the following steps are taken.
  • The delete timestamp for the given user is updated
  • The created timestamp for the newest message in the thread is retrieved
  • The delete timestamps for all members of the thread are compared to the timestamp of the newest private message.
  • If no messages have been created after every member has deleted the thread, the entire thread is deleted from the system.

Overrides EntityInterface::delete

File

src/Entity/PrivateMessageThreadInterface.php, line 207

Class

PrivateMessageThreadInterface
Provides an interface defining a Private Message thread entity.

Namespace

Drupal\private_message\Entity

Code

public function delete();