diff --git a/core/modules/aggregator/src/Entity/Feed.php b/core/modules/aggregator/src/Entity/Feed.php index d373ded..fb7ee9f 100644 --- a/core/modules/aggregator/src/Entity/Feed.php +++ b/core/modules/aggregator/src/Entity/Feed.php @@ -127,6 +127,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); $fields['title'] = BaseFieldDefinition::create('string') diff --git a/core/modules/aggregator/src/Entity/Item.php b/core/modules/aggregator/src/Entity/Item.php index d0f67dc..203354d 100644 --- a/core/modules/aggregator/src/Entity/Item.php +++ b/core/modules/aggregator/src/Entity/Item.php @@ -47,6 +47,7 @@ public function label() { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); $fields['fid'] = BaseFieldDefinition::create('entity_reference') diff --git a/core/modules/block_content/src/Entity/BlockContent.php b/core/modules/block_content/src/Entity/BlockContent.php index bf19ba9..8d50575 100644 --- a/core/modules/block_content/src/Entity/BlockContent.php +++ b/core/modules/block_content/src/Entity/BlockContent.php @@ -144,6 +144,7 @@ public function delete() { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); $fields['info'] = BaseFieldDefinition::create('string') @@ -159,12 +160,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setDisplayConfigurable('form', TRUE) ->addConstraint('UniqueField', []); - - $fields['type'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Block type')) - ->setDescription(t('The block type.')) - ->setSetting('target_type', 'block_content_type'); - $fields['revision_log'] = BaseFieldDefinition::create('string_long') ->setLabel(t('Revision log message')) ->setDescription(t('The log entry explaining the changes in this revision.')) diff --git a/core/modules/comment/src/Entity/Comment.php b/core/modules/comment/src/Entity/Comment.php index 608a34f..0b49a9b 100644 --- a/core/modules/comment/src/Entity/Comment.php +++ b/core/modules/comment/src/Entity/Comment.php @@ -208,6 +208,7 @@ public function permalink() { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); $fields['pid'] = BaseFieldDefinition::create('entity_reference') @@ -291,11 +292,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { ->setSetting('is_ascii', TRUE) ->setSetting('max_length', EntityTypeInterface::ID_MAX_LENGTH); - $fields['comment_type'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Comment Type')) - ->setDescription(t('The comment type.')) - ->setSetting('target_type', 'comment_type'); - $fields['field_name'] = BaseFieldDefinition::create('string') ->setLabel(t('Comment field name')) ->setDescription(t('The field name through which this comment was added.')) diff --git a/core/modules/contact/src/Entity/Message.php b/core/modules/contact/src/Entity/Message.php index 1cfcc2d..eaf877b 100644 --- a/core/modules/contact/src/Entity/Message.php +++ b/core/modules/contact/src/Entity/Message.php @@ -130,6 +130,7 @@ public function getPersonalRecipient() { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); $fields['name'] = BaseFieldDefinition::create('string') diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php index 66ef2e8..2775f6d 100644 --- a/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -214,6 +214,7 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); $fields['uid'] = BaseFieldDefinition::create('entity_reference') diff --git a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php index d375f00..685706f 100644 --- a/core/modules/menu_link_content/src/Entity/MenuLinkContent.php +++ b/core/modules/menu_link_content/src/Entity/MenuLinkContent.php @@ -233,15 +233,9 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); - $fields['bundle'] = BaseFieldDefinition::create('string') - ->setLabel(t('Bundle')) - ->setDescription(t('The content menu link bundle.')) - ->setSetting('max_length', EntityTypeInterface::BUNDLE_MAX_LENGTH) - ->setSetting('is_ascii', TRUE) - ->setReadOnly(TRUE); - $fields['title'] = BaseFieldDefinition::create('string') ->setLabel(t('Menu link title')) ->setDescription(t('The text to be used for this link in the menu.')) @@ -344,18 +338,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { 'weight' => -1, )); - $fields['langcode'] = BaseFieldDefinition::create('language') - ->setLabel(t('Language')) - ->setDescription(t('The menu link language code.')) - ->setTranslatable(TRUE) - ->setDisplayOptions('view', array( - 'type' => 'hidden', - )) - ->setDisplayOptions('form', array( - 'type' => 'language_select', - 'weight' => 2, - )); - $fields['parent'] = BaseFieldDefinition::create('string') ->setLabel(t('Parent plugin ID')) ->setDescription(t('The ID of the parent menu link plugin, or empty string when at the top level of the hierarchy.')); diff --git a/core/modules/shortcut/src/Entity/Shortcut.php b/core/modules/shortcut/src/Entity/Shortcut.php index 5fca74e..12a05d5 100644 --- a/core/modules/shortcut/src/Entity/Shortcut.php +++ b/core/modules/shortcut/src/Entity/Shortcut.php @@ -105,14 +105,9 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); - $fields['shortcut_set'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Shortcut set')) - ->setDescription(t('The bundle of the shortcut.')) - ->setSetting('target_type', 'shortcut_set') - ->setRequired(TRUE); - $fields['title'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')) ->setDescription(t('The name of the shortcut.')) @@ -145,18 +140,6 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { )) ->setDisplayConfigurable('form', TRUE); - $fields['langcode'] = BaseFieldDefinition::create('language') - ->setLabel(t('Language')) - ->setDescription(t('The language code of the shortcut.')) - ->setTranslatable(TRUE) - ->setDisplayOptions('view', array( - 'type' => 'hidden', - )) - ->setDisplayOptions('form', array( - 'type' => 'language_select', - 'weight' => 2, - )); - return $fields; } diff --git a/core/modules/taxonomy/src/Entity/Term.php b/core/modules/taxonomy/src/Entity/Term.php index 01517ff..0d25dd2 100644 --- a/core/modules/taxonomy/src/Entity/Term.php +++ b/core/modules/taxonomy/src/Entity/Term.php @@ -101,25 +101,9 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE) { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); - $fields['vid'] = BaseFieldDefinition::create('entity_reference') - ->setLabel(t('Vocabulary')) - ->setDescription(t('The vocabulary to which the term is assigned.')) - ->setSetting('target_type', 'taxonomy_vocabulary'); - - $fields['langcode'] = BaseFieldDefinition::create('language') - ->setLabel(t('Language')) - ->setDescription(t('The term language code.')) - ->setTranslatable(TRUE) - ->setDisplayOptions('view', array( - 'type' => 'hidden', - )) - ->setDisplayOptions('form', array( - 'type' => 'language_select', - 'weight' => 2, - )); - $fields['name'] = BaseFieldDefinition::create('string') ->setLabel(t('Name')) ->setDescription(t('The term name.')) diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php index 0a14750..15a84b9 100644 --- a/core/modules/user/src/Entity/User.php +++ b/core/modules/user/src/Entity/User.php @@ -425,8 +425,11 @@ public static function getAnonymousUser() { * {@inheritdoc} */ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { + /** @var \Drupal\Core\Field\BaseFieldDefinition[] $fields */ $fields = parent::baseFieldDefinitions($entity_type); + $fields['langcode']->setDisplayOptions('form', ['type' => 'hidden']); + $fields['preferred_langcode'] = BaseFieldDefinition::create('language') ->setLabel(t('Preferred language code')) ->setDescription(t("The user's preferred language code for receiving emails and viewing the site."))