public function EntityTestStorageController::baseFieldDefinitions

Implements \Drupal\Core\Entity\DataBaseStorageControllerNG::baseFieldDefinitions().

Overrides DatabaseStorageController::baseFieldDefinitions

File

drupal/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php, line 134
Definition of Drupal\entity_test\EntityTestStorageController.

Class

EntityTestStorageController
Defines the controller class for the test entity.

Namespace

Drupal\entity_test

Code

public function baseFieldDefinitions() {
  $fields['id'] = array(
    'label' => t('ID'),
    'description' => t('The ID of the test entity.'),
    'type' => 'integer_field',
    'read-only' => TRUE,
  );
  $fields['revision_id'] = array(
    'label' => t('ID'),
    'description' => t('The version 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',
  );
  $fields['langcode'] = array(
    'label' => t('Language code'),
    'description' => t('The language code of the test entity.'),
    'type' => 'language_field',
  );
  $fields['default_langcode'] = array(
    'label' => t('Default language'),
    'description' => t('Flag to inditcate whether this is the default language.'),
    'type' => 'boolean_field',
  );
  $fields['name'] = array(
    'label' => t('Name'),
    'description' => t('The name of the test entity.'),
    'type' => 'string_field',
    'translatable' => TRUE,
  );
  $fields['user_id'] = array(
    'label' => t('User ID'),
    'description' => t('The ID of the associated user.'),
    'type' => 'entityreference_field',
    'settings' => array(
      'entity type' => 'user',
    ),
    'translatable' => TRUE,
  );
  return $fields;
}