function EntityTestCompositeConstraint::baseFieldDefinitions
Overrides EntityTest::baseFieldDefinitions
File
-
core/
modules/ system/ tests/ modules/ entity_test/ src/ Entity/ EntityTestCompositeConstraint.php, line 37
Class
- EntityTestCompositeConstraint
- Defines a test class for testing composite constraints.
Namespace
Drupal\entity_test\EntityCode
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['name']->setDisplayOptions('form', [
'type' => 'string',
'weight' => 0,
]);
$fields['type']->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete',
'weight' => 0,
]);
return $fields;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.