function pbf_entity_delete in Permissions by field 8
Implements hook_entity_delete().
File
- ./
pbf.module, line 231 - Contains pbf.module.
Code
function pbf_entity_delete(EntityInterface $entity) {
$config = \Drupal::configFactory()
->getEditable('pbf.settings');
if ($entity instanceof RoleInterface) {
$roles_gids = $config
->get('pbf_roles_gids');
unset($roles_gids[$entity
->id()]);
$config
->set('pbf_roles_gids', $roles_gids);
$config
->save();
}
if ($entity instanceof FieldableEntityInterface) {
\Drupal::service('pbf.synchronize')
->synchronize('delete', $entity);
}
}