function ForumIndexStorage::create
Same name in other branches
- 9 core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::create()
- 8.9.x core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::create()
- 11.x core/modules/forum/src/ForumIndexStorage.php \Drupal\forum\ForumIndexStorage::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();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.