function farm_location_test_entity_base_field_info in farmOS 2.x
Implements hook_entity_base_field_info().
File
- modules/
core/ location/ tests/ modules/ farm_location_test/ farm_location_test.module, line 13 - Contains farm_location_test.module.
Code
function farm_location_test_entity_base_field_info(EntityTypeInterface $entity_type) {
$fields = [];
if ($entity_type
->id() == 'log') {
$options = [
'type' => 'entity_reference',
'label' => t('Asset'),
'target_type' => 'asset',
'multiple' => TRUE,
];
$fields['asset'] = \Drupal::service('farm_field.factory')
->baseFieldDefinition($options);
}
return $fields;
}