/**
  * {@inheritdoc}
  */
 public static function baseFieldDefinitions(EntityTypeInterface $entity_type)
 {
     $fields = parent::baseFieldDefinitions($entity_type);
     $fields['parent_id'] = BaseFieldDefinition::create('string')->setLabel(t('Parent ID'))->setDescription(t('The ID of the parent entity of which this entity is referenced.'));
     $fields['parent_type'] = BaseFieldDefinition::create('string')->setLabel(t('Parent type'))->setDescription(t('The entity parent type to which this entity is referenced.'));
     $fields['parent_field_name'] = BaseFieldDefinition::create('string')->setLabel(t('Parent field name'))->setDescription(t('The entity parent field name to which this entity is referenced.'));
     return $fields;
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public static function baseFieldDefinitions(EntityTypeInterface $entity_type)
 {
     $fields = parent::baseFieldDefinitions($entity_type);
     $fields += \Drupal::state()->get('entity_test_update.additional_base_field_definitions', array());
     return $fields;
 }