You are here

function drush_entity_hierarchy_rebuild_tree in Entity Reference Hierarchy 3.x

Same name and namespace in other branches
  1. 8.2 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();
}