function ForumIndexStorage::update

Same name in other branches
  1. 8.9.x core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::update()
  2. 10 core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::update()
  3. 11.x core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::update()

Overrides ForumIndexStorageInterface::update

File

core/modules/forum/src/ForumIndexStorage.php, line 83

Class

ForumIndexStorage
Handles CRUD operations to {forum_index} table.

Namespace

Drupal\forum

Code

public function update(NodeInterface $node) {
    $this->database
        ->update('forum')
        ->fields([
        'tid' => $node->forum_tid,
    ])
        ->condition('vid', $node->getRevisionId())
        ->execute();
}

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