You are here

function lightning_roles_install in Lightning Core 8

Same name and namespace in other branches
  1. 8.5 modules/lightning_roles/lightning_roles.install \lightning_roles_install()
  2. 8.2 modules/lightning_roles/lightning_roles.install \lightning_roles_install()
  3. 8.3 modules/lightning_roles/lightning_roles.install \lightning_roles_install()
  4. 8.4 modules/lightning_roles/lightning_roles.install \lightning_roles_install()

Implements hook_install().

File

modules/lightning_roles/lightning_roles.install, line 8

Code

function lightning_roles_install() {

  // Don't do anything during a config sync.
  if (\Drupal::isConfigSyncing()) {
    return;
  }

  // Create content roles for all existing node types.
  $node_types = NodeType::loadMultiple();
  array_walk($node_types, 'lightning_roles_node_type_insert');
}