function EntityTestUpdateHooks::viewPresave
Implements hook_ENTITY_TYPE_presave() for the 'view' entity type.
File
-
core/
modules/ system/ tests/ modules/ entity_test_update/ src/ Hook/ EntityTestUpdateHooks.php, line 61
Class
- EntityTestUpdateHooks
- Hook implementations for entity_test_update.
Namespace
Drupal\entity_test_update\HookCode
public function viewPresave(EntityInterface $entity) {
if (\Drupal::state()->get('entity_test_update.throw_view_exception') === $entity->id()) {
throw new \LogicException('The view could not be saved.');
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.