diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php index ec49cdb..1e084dc 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/IntegerItem.php @@ -53,6 +53,7 @@ public static function schema(FieldDefinitionInterface $field_definition) { 'value' => array( 'type' => 'int', 'not null' => TRUE, + 'default' => 0, ), ), ); diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php index 3bae65b..fbb56a2 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/LanguageItem.php @@ -65,7 +65,8 @@ public static function schema(FieldDefinitionInterface $field_definition) { 'value' => array( 'type' => 'varchar', 'length' => 12, - 'not null' => FALSE, + 'not null' => TRUE, + 'default' => '', ), ), ); diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php index ce78a40..7288ec7 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringItem.php @@ -55,8 +55,9 @@ public static function schema(FieldDefinitionInterface $field_definition) { 'columns' => array( 'value' => array( 'type' => 'varchar', - 'length' => $field_definition->getSetting('max_length'), - 'not null' => FALSE, + 'length' => (int) $field_definition->getSetting('max_length'), + 'not null' => TRUE, + 'default' => '', ), ), ); diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php new file mode 100644 index 0000000..613b5c9 --- /dev/null +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/StringLongItem.php @@ -0,0 +1,63 @@ +setLabel(t('Text value')); + } + return static::$propertyDefinitions; + } + + /** + * {@inheritdoc} + */ + public static function schema(FieldDefinitionInterface $field_definition) { + return array( + 'columns' => array( + 'value' => array( + 'type' => 'text', + 'size' => 'big', + 'not null' => TRUE, + 'default' => '', + ), + ), + ); + } + +} diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UnsignedIntegerItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UnsignedIntegerItem.php new file mode 100644 index 0000000..c7295c9 --- /dev/null +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UnsignedIntegerItem.php @@ -0,0 +1,61 @@ +setLabel(t('Unsigned integer value')); + } + return static::$propertyDefinitions; + } + /** + * {@inheritdoc} + */ + public static function schema(FieldDefinitionInterface $field_definition) { + return array( + 'columns' => array( + 'value' => array( + 'type' => 'int', + 'not null' => TRUE, + 'default' => 0, + 'unsigned' => TRUE, + ), + ), + ); + } + +} diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php index 147c3fd..5bb80d1 100644 --- a/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php +++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldType/UuidItem.php @@ -7,6 +7,8 @@ namespace Drupal\Core\Field\Plugin\Field\FieldType; +use Drupal\Core\Field\FieldDefinitionInterface; + /** * Defines the 'uuid' entity field type. * @@ -35,4 +37,14 @@ public function applyDefaultValue($notify = TRUE) { $this->setValue(array('value' => $uuid->generate()), $notify); return $this; } + + /** + * {@inheritdoc} + */ + public static function schema(FieldDefinitionInterface $field_definition) { + $schema = parent::schema($field_definition); + $schema['columns']['value']['length'] = 128; + return $schema; + } + } diff --git a/core/lib/Drupal/Core/TypedData/Plugin/DataType/UnsignedInteger.php b/core/lib/Drupal/Core/TypedData/Plugin/DataType/UnsignedInteger.php new file mode 100644 index 0000000..667e1fb --- /dev/null +++ b/core/lib/Drupal/Core/TypedData/Plugin/DataType/UnsignedInteger.php @@ -0,0 +1,26 @@ + 'Stores feeds to be parsed by the aggregator.', + 'description' => 'The base table for aggregator_feed entities.', 'fields' => array( 'fid' => array( 'type' => 'serial', @@ -65,6 +65,7 @@ function aggregator_schema() { 'not null' => TRUE, 'default' => 0, 'description' => 'How often to check for new feed items, in seconds.', + 'unsigned' => TRUE, ), 'checked' => array( 'type' => 'int', @@ -92,7 +93,6 @@ function aggregator_schema() { 'image' => array( 'type' => 'text', 'not null' => TRUE, - 'size' => 'big', 'description' => 'An image representing the feed.', ), 'hash' => array( @@ -127,7 +127,7 @@ function aggregator_schema() { ); $schema['aggregator_item'] = array( - 'description' => 'Stores the individual items imported from feeds.', + 'description' => 'The base table for aggregator_item entities.', 'fields' => array( 'iid' => array( 'type' => 'serial', diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php index ba7c846..1abf115 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Feed.php @@ -116,29 +116,29 @@ public static function postDelete(EntityStorageControllerInterface $storage_cont * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['fid'] = FieldDefinition::create('integer') + $fields['fid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Feed ID')) - ->setDescription(t('The ID of the aggregator feed.')) + ->setDescription(t('Primary Key: Unique feed ID.')) ->setReadOnly(TRUE); $fields['uuid'] = FieldDefinition::create('uuid') ->setLabel(t('UUID')) - ->setDescription(t('The aggregator feed UUID.')) + ->setDescription(t('Unique Key: Universally unique identifier for this entity.')) ->setReadOnly(TRUE); $fields['title'] = FieldDefinition::create('string') ->setLabel(t('Title')) - ->setDescription(t('The title of the feed.')); + ->setDescription(t('Title of the feed.')); $fields['langcode'] = FieldDefinition::create('language') ->setLabel(t('Language code')) - ->setDescription(t('The feed language code.')); + ->setDescription(t('The {language}.langcode of this feed.')); $fields['url'] = FieldDefinition::create('uri') ->setLabel(t('URL')) - ->setDescription(t('The URL to the feed.')); + ->setDescription(t('URL to the feed.')); - $fields['refresh'] = FieldDefinition::create('integer') + $fields['refresh'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Refresh')) ->setDescription(t('How often to check for new feed items, in seconds.')); @@ -154,11 +154,11 @@ public static function baseFieldDefinitions($entity_type) { $fields['link'] = FieldDefinition::create('uri') ->setLabel(t('Link')) - ->setDescription(t('The link of the feed.')); + ->setDescription(t('The parent website of the feed; comes from the element in the feed.')); - $fields['description'] = FieldDefinition::create('string') + $fields['description'] = FieldDefinition::create('string_long') ->setLabel(t('Description')) - ->setDescription(t("The parent website's description that comes from the !description element in the feed.", array('!description' => ''))); + ->setDescription(t("The parent website's description; comes from the !description element in the feed.", array('!description' => ''))); $fields['image'] = FieldDefinition::create('uri') ->setLabel(t('Image')) diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php index e48e45d9..425a58b 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Entity/Item.php @@ -61,36 +61,36 @@ public function postCreate(EntityStorageControllerInterface $storage_controller) * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['iid'] = FieldDefinition::create('integer') + $fields['iid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Aggregator item ID')) - ->setDescription(t('The ID of the feed item.')) + ->setDescription(t('Primary Key: Unique ID for feed item.')) ->setReadOnly(TRUE); $fields['fid'] = FieldDefinition::create('entity_reference') ->setLabel(t('Aggregator feed ID')) - ->setDescription(t('The ID of the aggregator feed.')) + ->setDescription(t('The {aggregator_feed}.fid to which this item belongs.')) ->setSetting('target_type', 'aggregator_feed'); $fields['title'] = FieldDefinition::create('string') ->setLabel(t('Title')) - ->setDescription(t('The title of the feed item.')); + ->setDescription(t('Title of the feed item.')); $fields['langcode'] = FieldDefinition::create('language') ->setLabel(t('Language code')) - ->setDescription(t('The feed item language code.')); + ->setDescription(t('The {language}.langcode of this feed item.')); $fields['link'] = FieldDefinition::create('uri') ->setLabel(t('Link')) - ->setDescription(t('The link of the feed item.')); + ->setDescription(t('Link to the feed item.')); $fields['author'] = FieldDefinition::create('string') ->setLabel(t('Author')) - ->setDescription(t('The author of the feed item.')); + ->setDescription(t('Author of the feed item.')); // @todo Convert to a text field in https://drupal.org/node/2149845. $fields['description'] = FieldDefinition::create('string') ->setLabel(t('Description')) - ->setDescription(t('The body of the feed item.')); + ->setDescription(t('Body of the feed item.')); // @todo Convert to a "timestamp" field in https://drupal.org/node/2145103. $fields['timestamp'] = FieldDefinition::create('integer') diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php index 643fa33..b6c87e1 100644 --- a/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php +++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Entity/CustomBlock.php @@ -164,7 +164,7 @@ public function delete() { * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['id'] = FieldDefinition::create('integer') + $fields['id'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Custom block ID')) ->setDescription(t('The custom block ID.')) ->setReadOnly(TRUE); @@ -174,7 +174,7 @@ public static function baseFieldDefinitions($entity_type) { ->setDescription(t('The custom block UUID.')) ->setReadOnly(TRUE); - $fields['revision_id'] = FieldDefinition::create('integer') + $fields['revision_id'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Revision ID')) ->setDescription(t('The revision ID.')) ->setReadOnly(TRUE); diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php index 6bcfd95..62aa58b 100644 --- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php @@ -353,7 +353,7 @@ public function permalink() { * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['cid'] = FieldDefinition::create('integer') + $fields['cid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Comment ID')) ->setDescription(t('The comment ID.')) ->setReadOnly(TRUE); @@ -365,12 +365,12 @@ public static function baseFieldDefinitions($entity_type) { $fields['pid'] = FieldDefinition::create('entity_reference') ->setLabel(t('Parent ID')) - ->setDescription(t('The parent comment ID if this is a reply to a comment.')) + ->setDescription(t('The parent comment ID if this is a reply to a comment, as a Unix timestamp.')) ->setSetting('target_type', 'comment'); $fields['entity_id'] = FieldDefinition::create('entity_reference') ->setLabel(t('Entity ID')) - ->setDescription(t('The ID of the entity of which this comment is a reply.')) + ->setDescription(t('The ID of the entity of which this comment is a reply, as a Unix timestamp.')) ->setSetting('target_type', 'node') ->setRequired(TRUE); diff --git a/core/modules/file/lib/Drupal/file/Entity/File.php b/core/modules/file/lib/Drupal/file/Entity/File.php index 816435b..2979ad3 100644 --- a/core/modules/file/lib/Drupal/file/Entity/File.php +++ b/core/modules/file/lib/Drupal/file/Entity/File.php @@ -225,7 +225,7 @@ public static function preDelete(EntityStorageControllerInterface $storage_contr * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['fid'] = FieldDefinition::create('integer') + $fields['fid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('File ID')) ->setDescription(t('The file ID.')) ->setReadOnly(TRUE); @@ -256,7 +256,7 @@ public static function baseFieldDefinitions($entity_type) { ->setLabel(t('File MIME type')) ->setDescription(t("The file's MIME type.")); - $fields['filesize'] = FieldDefinition::create('integer') + $fields['filesize'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('File size')) ->setDescription(t('The size of the file in bytes.')); diff --git a/core/modules/node/lib/Drupal/node/Entity/Node.php b/core/modules/node/lib/Drupal/node/Entity/Node.php index 0d4683e..c32a8a3 100644 --- a/core/modules/node/lib/Drupal/node/Entity/Node.php +++ b/core/modules/node/lib/Drupal/node/Entity/Node.php @@ -344,7 +344,7 @@ public function setRevisionAuthorId($uid) { * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['nid'] = FieldDefinition::create('integer') + $fields['nid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Node ID')) ->setDescription(t('The node ID.')) ->setReadOnly(TRUE); @@ -354,7 +354,7 @@ public static function baseFieldDefinitions($entity_type) { ->setDescription(t('The node UUID.')) ->setReadOnly(TRUE); - $fields['vid'] = FieldDefinition::create('integer') + $fields['vid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Revision ID')) ->setDescription(t('The node revision ID.')) ->setReadOnly(TRUE); @@ -369,7 +369,7 @@ public static function baseFieldDefinitions($entity_type) { ->setLabel(t('Language code')) ->setDescription(t('The node language code.')); - $fields['title'] = FieldDefinition::create('text') + $fields['title'] = FieldDefinition::create('string') // @todo Account for $node_type->title_label when per-bundle overrides are // possible - https://drupal.org/node/2114707. ->setLabel(t('Title')) diff --git a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php index 59f8287..762ea0e 100644 --- a/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php +++ b/core/modules/shortcut/lib/Drupal/shortcut/Entity/Shortcut.php @@ -134,7 +134,7 @@ public function preSave(EntityStorageControllerInterface $storage_controller) { * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['id'] = FieldDefinition::create('integer') + $fields['id'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('ID')) ->setDescription(t('The ID of the shortcut.')) ->setReadOnly(TRUE); diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php index f97a44f..7804da8 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php @@ -236,6 +236,7 @@ function testEntityQuery() { // word but allows us to test revisions and string operations. $ids = $this->factory->get('entity_test_mulrev') ->condition("$greetings.value", 'merhaba') + ->sort('id') ->execute(); $entities = entity_load_multiple('entity_test_mulrev', $ids); foreach ($entities as $entity) { @@ -268,12 +269,14 @@ function testEntityQuery() { $this->assertIdentical($results, $assert); $results = $this->factory->get('entity_test_mulrev') ->condition("$greetings.value", 'siema', 'STARTS_WITH') + ->sort('revision_id') ->execute(); // Now we only get the ones that originally were siema, entity id 8 and // above. $this->assertIdentical($results, array_slice($assert, 4, 8, TRUE)); $results = $this->factory->get('entity_test_mulrev') ->condition("$greetings.value", 'a', 'ENDS_WITH') + ->sort('revision_id') ->execute(); // It is very important that we do not get the ones which only have // xsiemax despite originally they were merhaba, ie. ended with a. diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php index 9798c4f..8686cfd 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTest.php @@ -124,7 +124,7 @@ public function label() { * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['id'] = FieldDefinition::create('integer') + $fields['id'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('ID')) ->setDescription(t('The ID of the test entity.')) ->setReadOnly(TRUE); diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php index e0dce68..3886440 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestMulRev.php @@ -50,7 +50,7 @@ class EntityTestMulRev extends EntityTestRev { public static function baseFieldDefinitions($entity_type) { $fields = parent::baseFieldDefinitions($entity_type); - $fields['revision_id'] = FieldDefinition::create('integer') + $fields['revision_id'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Revision ID')) ->setDescription(t('The version id of the test entity.')) ->setReadOnly(TRUE); diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php index a31dcdc..84f7471 100644 --- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php +++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Entity/EntityTestRev.php @@ -69,7 +69,7 @@ public function getRevisionId() { public static function baseFieldDefinitions($entity_type) { $fields = parent::baseFieldDefinitions($entity_type); - $fields['revision_id'] = FieldDefinition::create('integer') + $fields['revision_id'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Revision ID')) ->setDescription(t('The version id of the test entity.')) ->setReadOnly(TRUE); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php index b28a6d9..7898d2f 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Entity/Term.php @@ -197,7 +197,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $ * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['tid'] = FieldDefinition::create('integer') + $fields['tid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Term ID')) ->setDescription(t('The term ID.')) ->setReadOnly(TRUE); @@ -229,7 +229,7 @@ public static function baseFieldDefinitions($entity_type) { ->setDescription(t('The weight of this term in relation to other terms.')) ->setSetting('default_value', 0); - $fields['parent'] = FieldDefinition::create('integer') + $fields['parent'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('Term Parents')) ->setDescription(t('The parents of this term.')) // Save new terms with no parents by default. diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextFormattedItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextFormattedItem.php new file mode 100644 index 0000000..6049b7a --- /dev/null +++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextFormattedItem.php @@ -0,0 +1,70 @@ + array( + 'value' => array( + 'type' => 'text', + 'size' => 'big', + 'not null' => FALSE, + ), + 'format' => array( + 'type' => 'varchar', + 'length' => 255, + 'not null' => FALSE, + ), + ), + 'indexes' => array( + 'format' => array('format'), + ), + ); + } + + /** + * {@inheritdoc} + */ + public function instanceSettingsForm(array $form, array &$form_state) { + $element = array(); + + $element['text_processing'] = array( + '#type' => 'radios', + '#title' => t('Text processing'), + '#default_value' => $this->getFieldSetting('text_processing'), + '#options' => array( + t('Plain text'), + t('Filtered text (user selects text format)'), + ), + ); + + return $element; + } + +} diff --git a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php index 7e378fc..c6e18ac 100644 --- a/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php +++ b/core/modules/text/lib/Drupal/text/Plugin/Field/FieldType/TextLongItem.php @@ -34,7 +34,7 @@ public static function schema(FieldDefinitionInterface $field_definition) { 'value' => array( 'type' => 'text', 'size' => 'big', - 'not null' => FALSE, + 'not null' => TRUE, ), 'format' => array( 'type' => 'varchar', diff --git a/core/modules/user/lib/Drupal/user/Entity/User.php b/core/modules/user/lib/Drupal/user/Entity/User.php index 2954df5..c29b53d 100644 --- a/core/modules/user/lib/Drupal/user/Entity/User.php +++ b/core/modules/user/lib/Drupal/user/Entity/User.php @@ -423,7 +423,7 @@ public function setUsername($username) { * {@inheritdoc} */ public static function baseFieldDefinitions($entity_type) { - $fields['uid'] = FieldDefinition::create('integer') + $fields['uid'] = FieldDefinition::create('unsigned_integer') ->setLabel(t('User ID')) ->setDescription(t('The user ID.')) ->setReadOnly(TRUE);