function ctools_entity_mask_entity_type_alter
Same name in other branches
- 8.x-3.x modules/ctools_entity_mask/ctools_entity_mask.module \ctools_entity_mask_entity_type_alter()
Implements hook_entity_type_alter().
File
-
modules/
ctools_entity_mask/ ctools_entity_mask.module, line 51
Code
function ctools_entity_mask_entity_type_alter(array &$entity_types) {
/** @var \Drupal\Core\Entity\EntityTypeInterface $entity_type */
foreach ($entity_types as $entity_type) {
// Mask entities should use our specialized storage handler, which simulates
// a save but does not write anything to the database.
if ($entity_type->get('mask') && $entity_type->getStorageClass() == SqlContentEntityStorage::class) {
$entity_type->setStorageClass(MaskContentEntityStorage::class);
// Mask entities should not maintain any tables.
$entity_type->set('base_table', NULL);
$entity_type->set('revision_table', NULL);
$entity_type->set('data_table', NULL);
$entity_type->set('revision_data_table', NULL);
// Nor should they be exposed to Field UI.
$entity_type->set('field_ui_base_route', NULL);
}
}
}