function EntityTestWithRevisionLog::baseFieldDefinitions
Overrides RevisionableContentEntityBase::baseFieldDefinitions
1 call to EntityTestWithRevisionLog::baseFieldDefinitions()
- EntityTestMulWithRevisionLogPub::baseFieldDefinitions in core/
modules/ system/ tests/ modules/ entity_test_revlog/ src/ Entity/ EntityTestMulWithRevisionLogPub.php  - Provides base field definitions for an entity type.
 
1 method overrides EntityTestWithRevisionLog::baseFieldDefinitions()
- EntityTestMulWithRevisionLogPub::baseFieldDefinitions in core/
modules/ system/ tests/ modules/ entity_test_revlog/ src/ Entity/ EntityTestMulWithRevisionLogPub.php  - Provides base field definitions for an entity type.
 
File
- 
              core/
modules/ system/ tests/ modules/ entity_test_revlog/ src/ Entity/ EntityTestWithRevisionLog.php, line 60  
Class
- EntityTestWithRevisionLog
 - Defines the test entity class.
 
Namespace
Drupal\entity_test_revlog\EntityCode
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  $fields = parent::baseFieldDefinitions($entity_type);
  $fields['name'] = BaseFieldDefinition::create('string')->setLabel(t('Name'))
    ->setDescription(t('The name of the test entity.'))
    ->setRevisionable(TRUE)
    ->setSetting('max_length', 64)
    ->setDisplayOptions('view', [
    'label' => 'hidden',
    'type' => 'string',
    'weight' => -5,
  ])
    ->setDisplayOptions('form', [
    'type' => 'string_textfield',
    'weight' => -5,
  ]);
  return $fields;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.