summaryrefslogtreecommitdiffstats
path: root/core/modules/node/src/Entity/Node.php
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-02-15 09:27:14 +0900
committerNathaniel Catchpole2016-02-15 09:27:14 +0900
commit7e4b50e68fbf561923d40ac60ca599bf7e43b0ee (patch)
tree1b6344aaed4d315078184a64f6a3eda6f15463cb /core/modules/node/src/Entity/Node.php
parentd5f4e3b8ff92a4460bb8bf150d6b4251ea6ac0c8 (diff)
Issue #2635224 by dawehner, bojanz: ContentEntityBase should provide field definitions for key fields
Diffstat (limited to 'core/modules/node/src/Entity/Node.php')
-rw-r--r--core/modules/node/src/Entity/Node.php36
1 files changed, 1 insertions, 35 deletions
diff --git a/core/modules/node/src/Entity/Node.php b/core/modules/node/src/Entity/Node.php
index cd9b4e5..7b20a3b 100644
--- a/core/modules/node/src/Entity/Node.php
+++ b/core/modules/node/src/Entity/Node.php
@@ -325,41 +325,7 @@ class Node extends ContentEntityBase implements NodeInterface {
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
- $fields['nid'] = BaseFieldDefinition::create('integer')
- ->setLabel(t('Node ID'))
- ->setDescription(t('The node ID.'))
- ->setReadOnly(TRUE)
- ->setSetting('unsigned', TRUE);
-
- $fields['uuid'] = BaseFieldDefinition::create('uuid')
- ->setLabel(t('UUID'))
- ->setDescription(t('The node UUID.'))
- ->setReadOnly(TRUE);
-
- $fields['vid'] = BaseFieldDefinition::create('integer')
- ->setLabel(t('Revision ID'))
- ->setDescription(t('The node revision ID.'))
- ->setReadOnly(TRUE)
- ->setSetting('unsigned', TRUE);
-
- $fields['type'] = BaseFieldDefinition::create('entity_reference')
- ->setLabel(t('Type'))
- ->setDescription(t('The node type.'))
- ->setSetting('target_type', 'node_type')
- ->setReadOnly(TRUE);
-
- $fields['langcode'] = BaseFieldDefinition::create('language')
- ->setLabel(t('Language'))
- ->setDescription(t('The node language code.'))
- ->setTranslatable(TRUE)
- ->setRevisionable(TRUE)
- ->setDisplayOptions('view', array(
- 'type' => 'hidden',
- ))
- ->setDisplayOptions('form', array(
- 'type' => 'language_select',
- 'weight' => 2,
- ));
+ $fields = parent::baseFieldDefinitions($entity_type);
$fields['title'] = BaseFieldDefinition::create('string')
->setLabel(t('Title'))