Make the asset field in test modules a BaseFieldDefinition and allow multiple values.

This commit is contained in:
Michael Stenta 2021-03-25 08:42:30 -04:00
parent 5aae9412d3
commit 319fcad256
3 changed files with 6 additions and 3 deletions

View File

@ -17,8 +17,9 @@ function farm_group_test_entity_base_field_info(EntityTypeInterface $entity_type
'type' => 'entity_reference',
'label' => t('Asset'),
'target_type' => 'asset',
'multiple' => TRUE,
];
$fields['asset'] = \Drupal::service('farm_field.factory')->bundleFieldDefinition($options);
$fields['asset'] = \Drupal::service('farm_field.factory')->baseFieldDefinition($options);
}
return $fields;
}

View File

@ -17,8 +17,9 @@ function farm_location_test_entity_base_field_info(EntityTypeInterface $entity_t
'type' => 'entity_reference',
'label' => t('Asset'),
'target_type' => 'asset',
'multiple' => TRUE,
];
$fields['asset'] = \Drupal::service('farm_field.factory')->bundleFieldDefinition($options);
$fields['asset'] = \Drupal::service('farm_field.factory')->baseFieldDefinition($options);
}
return $fields;
}

View File

@ -17,8 +17,9 @@ function farm_log_query_test_entity_base_field_info(EntityTypeInterface $entity_
'type' => 'entity_reference',
'label' => t('Asset'),
'target_type' => 'asset',
'multiple' => TRUE,
];
$fields['asset'] = \Drupal::service('farm_field.factory')->bundleFieldDefinition($options);
$fields['asset'] = \Drupal::service('farm_field.factory')->baseFieldDefinition($options);
}
return $fields;
}