You are here

public function ForumIndexStorage::create in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::create()

Creates a record in {forum} table for the given node.

Parameters

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

Overrides ForumIndexStorageInterface::create

File

core/modules/forum/src/ForumIndexStorage.php, line 45
Contains \Drupal\forum\ForumIndexStorage.

Class

ForumIndexStorage
Handles CRUD operations to {forum_index} table.

Namespace

Drupal\forum

Code

public function create(NodeInterface $node) {
  $this->database
    ->insert('forum')
    ->fields(array(
    'tid' => $node->forum_tid,
    'vid' => $node
      ->getRevisionId(),
    'nid' => $node
      ->id(),
  ))
    ->execute();
}