function field_test_field_storage_config_update_forbid in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/field/tests/modules/field_test/field_test.field.inc \field_test_field_storage_config_update_forbid()
Implements hook_field_storage_config_update_forbid().
File
- core/
modules/ field/ tests/ modules/ field_test/ field_test.field.inc, line 27 - Defines a field type and its formatters and widgets.
Code
function field_test_field_storage_config_update_forbid(FieldStorageConfigInterface $field_storage, FieldStorageConfigInterface $prior_field_storage) {
if ($field_storage
->getType() == 'test_field' && $field_storage
->getSetting('unchangeable') != $prior_field_storage
->getSetting('unchangeable')) {
throw new FieldStorageDefinitionUpdateForbiddenException("field_test 'unchangeable' setting cannot be changed'");
}
}