You are here

function drush_entity_hierarchy_rebuild_tree in Entity Reference Hierarchy 8.2

Same name and namespace in other branches
  1. 3.x entity_hierarchy.drush.inc \drush_entity_hierarchy_rebuild_tree()

Rebuild the tree.

File

./entity_hierarchy.drush.inc, line 31
Contains drush commands for the module.

Code

function drush_entity_hierarchy_rebuild_tree($field_name, $entity_type_id) {
  $tasks = \Drupal::service('entity_hierarchy.tree_rebuilder')
    ->getRebuildTasks($field_name, $entity_type_id);
  batch_set($tasks);
  $batch =& batch_get();
  $batch['progressive'] = FALSE;
  drush_backend_batch_process();
}