1 node.module node_save(Node $node)

Saves a new or updated node.

Parameters

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.

Return value

int: Either SAVED_NEW or SAVED_UPDATED depending on the operation performed.

File

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

Code

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