function node_save

Saves changes to a node or adds a new node.

Parameters

Drupal\node\Node $node: The $node entity to be saved. If $node->nid is omitted (or $node->is_new is TRUE), a new node will be added.

6 calls to node_save()
CommentLinksTest::setEnvironment in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentLinksTest.php
Re-configures the environment, module settings, and user permissions.
CommentRssTest::testCommentRss in drupal/core/modules/comment/lib/Drupal/comment/Tests/CommentRssTest.php
Tests comments as part of an RSS feed.
NodeRevisionPermissionsTest::setUp in drupal/core/modules/node/lib/Drupal/node/Tests/NodeRevisionPermissionsTest.php
Sets up a Drupal site for running functional and integration tests.
NodeRevisionsTest::testRevisions in drupal/core/modules/node/lib/Drupal/node/Tests/NodeRevisionsTest.php
Checks node revision related operations.
node_test_node_insert in drupal/core/modules/node/tests/modules/node_test/node_test.module
Implements hook_node_insert().

... See full list

1 string reference to 'node_save'
menu_test_menu in drupal/core/modules/system/tests/modules/menu_test/menu_test.module
Implements hook_menu().

File

drupal/core/modules/node/node.module, line 996
The core module that allows content to be submitted to the site.

Code

function node_save(Node $node) {
  $node
    ->save();
}