function EntityTestMulRevPubStringId::baseFieldDefinitions
Overrides EntityTestMulRevPub::baseFieldDefinitions
File
-
core/
modules/ workspaces/ tests/ modules/ workspaces_test/ src/ Entity/ EntityTestMulRevPubStringId.php, line 61
Class
- EntityTestMulRevPubStringId
- Defines the test entity class.
Namespace
Drupal\workspaces_test\EntityCode
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['id'] = BaseFieldDefinition::create('string')->setLabel(t('ID'))
->setDescription(t('The ID of the test entity.'))
->setReadOnly(TRUE)
->setSetting('is_ascii', TRUE);
return $fields;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.