You are here

function taxonomy_term_depth_install in Taxonomy Term Depth 8

Same name and namespace in other branches
  1. 8.2 taxonomy_term_depth.install \taxonomy_term_depth_install()
  2. 7 taxonomy_term_depth.install \taxonomy_term_depth_install()

Implements hook_install()

1 call to taxonomy_term_depth_install()
taxonomy_term_depth_update_8005 in ./taxonomy_term_depth.install
Update entity schema.

File

./taxonomy_term_depth.install, line 17
Install file.

Code

function taxonomy_term_depth_install() {
  _taxonomy_term_depth_install_addfield();

  // Create field storage for the 'Highlight' base field.
  $entity_manager = \Drupal::service('entity.manager');
  $definition = $entity_manager
    ->getFieldStorageDefinitions('taxonomy_term')['depth_level'];
  $entity_manager
    ->onFieldStorageDefinitionCreate($definition);

  // Queue all terms to update depths.

  /**
   * @var $queue_manager Drupal\taxonomy_term_depth\QueueManager\Manager.
   */
  $queue_manager = \Drupal::service('taxonomy_term_depth.queue_service');
  $queue_manager
    ->queueBatch();
}