function lightning_roles_install in Lightning Core 8
Same name and namespace in other branches
- 8.5 modules/lightning_roles/lightning_roles.install \lightning_roles_install()
- 8.2 modules/lightning_roles/lightning_roles.install \lightning_roles_install()
- 8.3 modules/lightning_roles/lightning_roles.install \lightning_roles_install()
- 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');
}