function contact_storage_test_entity_base_field_info in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/contact/tests/modules/contact_storage_test/contact_storage_test.module \contact_storage_test_entity_base_field_info()
Implements hook_entity_base_field_info().
File
- core/
modules/ contact/ tests/ modules/ contact_storage_test/ contact_storage_test.module, line 15 - Contains custom contact message functionality for ContactStorageTest.
Code
function contact_storage_test_entity_base_field_info(\Drupal\Core\Entity\EntityTypeInterface $entity_type) {
if ($entity_type
->id() == 'contact_message') {
$fields = array();
$fields['id'] = BaseFieldDefinition::create('integer')
->setLabel(t('Message ID'))
->setDescription(t('The message ID.'))
->setReadOnly(TRUE)
->setSetting('unsigned', TRUE);
return $fields;
}
}