Newer
Older
<?php
/**
* @file
* Definition of Drupal\entity_test\Entity\EntityTestMul.
namespace Drupal\entity_test\Entity;
use Drupal\Core\Field\FieldDefinition;
use Drupal\entity_test\Entity\EntityTest;
/**
* Defines the test entity class.
*
* @EntityType(
* id = "entity_test_mul",
* label = @Translation("Test entity - data table"),
* controllers = {
Alex Pott
committed
* "storage" = "Drupal\Core\Entity\FieldableDatabaseStorageController",
* "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
* "access" = "Drupal\entity_test\EntityTestAccessController",
* "form" = {
* "default" = "Drupal\entity_test\EntityTestFormController"
* },
* "translation" = "Drupal\content_translation\ContentTranslationController"
* },
* base_table = "entity_test_mul",
* data_table = "entity_test_mul_property_data",
* fieldable = TRUE,
Angie Byron
committed
* translatable = TRUE,
* entity_keys = {
* "id" = "id",
* "uuid" = "uuid",
* "bundle" = "type",
* "label" = "name"
* links = {
* "canonical" = "entity_test.edit_entity_test_mul",
catch
committed
* "edit-form" = "entity_test.edit_entity_test_mul",
* "admin-form" = "entity_test.admin_entity_test_mul"
* }
* )
*/
class EntityTestMul extends EntityTest {
Alex Pott
committed
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions($entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['default_langcode'] = FieldDefinition::create('boolean')
->setLabel(t('Default language'))
->setDescription(t('Flag to indicate whether this is the default language.'));
Alex Pott
committed
return $fields;
}