public function ForumIndexStorage::create in Drupal 9
Same name and namespace in other branches
- 8 core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::create()
- 10 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 41
Class
- ForumIndexStorage
- Handles CRUD operations to {forum_index} table.
Namespace
Drupal\forumCode
public function create(NodeInterface $node) {
$this->database
->insert('forum')
->fields([
'tid' => $node->forum_tid,
'vid' => $node
->getRevisionId(),
'nid' => $node
->id(),
])
->execute();
}