function lightning_api_entity_insert in Lightning API 8.3
Same name and namespace in other branches
- 8.4 lightning_api.module \lightning_api_entity_insert()
- 8 lightning_api.module \lightning_api_entity_insert()
- 8.2 lightning_api.module \lightning_api_entity_insert()
Implements hook_entity_insert().
1 call to lightning_api_entity_insert()
- FixtureContext::setUp in tests/
src/ FixtureContext.php - @BeforeScenario
File
- ./
lightning_api.module, line 17 - Progressive decoupling? No problem.
Code
function lightning_api_entity_insert(EntityInterface $entity) {
$allowed = Drupal::config('lightning_api.settings')
->get('entity_json');
if ($entity
->getEntityType()
->getBundleOf() && $allowed) {
Drupal::service('router.builder')
->rebuild();
Drupal::service('router.route_provider')
->reset();
}
}