Defines the base properties of the entity type.
@todo: Define abstract once all entity types have been converted.
Overrides DatabaseStorageController::baseFieldDefinitions
public function baseFieldDefinitions() {
$fields['id'] = array(
'label' => t('ID'),
'description' => t('The ID of the test entity.'),
'type' => 'integer_field',
'read-only' => TRUE,
);
$fields['uuid'] = array(
'label' => t('UUID'),
'description' => t('The UUID of the test entity.'),
'type' => 'string_field',
'property_constraints' => array(
'value' => array(
'Length' => array(
'max' => 128,
),
),
),
);
$fields['langcode'] = array(
'label' => t('Language code'),
'description' => t('The language code of the test entity.'),
'type' => 'language_field',
);
$fields['name'] = array(
'label' => t('Name'),
'description' => t('The name of the test entity.'),
'type' => 'string_field',
'translatable' => TRUE,
'property_constraints' => array(
'value' => array(
'Length' => array(
'max' => 32,
),
),
),
);
$fields['type'] = array(
'label' => t('Type'),
'description' => t('The bundle of the test entity.'),
'type' => 'string_field',
'required' => TRUE,
);
$fields['user_id'] = array(
'label' => t('User ID'),
'description' => t('The ID of the associated user.'),
'type' => 'entity_reference_field',
'settings' => array(
'target_type' => 'user',
),
'translatable' => TRUE,
);
return $fields;
}