Same name and namespace in other branches
  1. 5.x modules/node/node.module \node_type_update_nodes()
  2. 6.x modules/node/node.module \node_type_update_nodes()
  3. 7.x modules/node/node.module \node_type_update_nodes()
  4. 8.9.x core/modules/node/node.module \node_type_update_nodes()
  5. 9 core/modules/node/node.module \node_type_update_nodes()

Updates all nodes of one type to be of another type.

Parameters

string $old_id: The current node type of the nodes.

string $new_id: The new node type of the nodes.

Return value

int The number of nodes whose node type field was modified.

Deprecated

in drupal:10.1.0 and is removed from drupal:11.0.0. Use \Drupal\Core\Entity\EntityStorageInterface::updateType instead.

See also

https://www.drupal.org/node/3323340

File

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

Code

function node_type_update_nodes($old_id, $new_id) {
  @trigger_error(__METHOD__ . ' is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use \\Drupal\\Core\\Entity\\EntityStorageInterface::updateType instead. See https://www.drupal.org/node/3294237', E_USER_DEPRECATED);
  return \Drupal::entityTypeManager()
    ->getStorage('node')
    ->updateType($old_id, $new_id);
}