function Comment::releaseThreadLock

Same name in other branches
  1. 9 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::releaseThreadLock()
  2. 8.9.x core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::releaseThreadLock()
  3. 11.x core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::releaseThreadLock()

Release the lock acquired for the thread in preSave().

1 call to Comment::releaseThreadLock()
Comment::postSave in core/modules/comment/src/Entity/Comment.php
Acts on a saved entity before the insert or update hook is invoked.

File

core/modules/comment/src/Entity/Comment.php, line 178

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

protected function releaseThreadLock() {
    if ($this->threadLock) {
        \Drupal::lock()->release($this->threadLock);
        $this->threadLock = '';
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.