You are here

public function ForumIndexStorage::update in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::update()
  2. 10 core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::update()

Updates the {forum} table for the given node.

Parameters

\Drupal\node\NodeInterface $node: The node for which the record is to be updated.

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();
}