Defines the test entity class.
@ContentEntityType(
id = "entity_test_composite",
label = @Translation("Test entity - composite relationship"),
base_table = "translatable_entity_test",
data_table = "translatable_entity_test_data",
entity_revision_parent_type_field = "parent_type",
translatable = TRUE,
content_translation_ui_skip = TRUE,
handlers = {
"access" = "Drupal\entity_test\EntityTestAccessControlHandler",
"view_builder" = "Drupal\entity_test\EntityTestViewBuilder"
},
entity_keys = {
"id" = "id",
"uuid" = "uuid",
"bundle" = "type",
"label" = "name",
"langcode" = "langcode",
}
)
Expanded class hierarchy of EntityTestComposite
class EntityTestComposite extends EntityTestMul {
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['parent_type'] = BaseFieldDefinition::create('string')
->setLabel(t('Parent type'))
->setDescription(t('The entity parent type to which this entity is referenced.'));
return $fields;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityTestComposite:: |
public static | function |