function onlyone_node_type_delete in Allow a content type only once (Only One) 8
Same name and namespace in other branches
- 7 onlyone.module \onlyone_node_type_delete()
Implements hook_node_type_delete().
File
- ./
onlyone.module, line 217 - Contains onlyone.module.
Code
function onlyone_node_type_delete(EntityInterface $node) {
// Getting the content type machine name.
$content_type = $node
->id();
// Deleting the value from the config.
\Drupal::service('onlyone')
->deleteContentTypeConfig($content_type);
}