function EntityTestMulRevChanged::baseFieldDefinitions

Same name in other branches
  1. 9 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php \Drupal\entity_test\Entity\EntityTestMulRevChanged::baseFieldDefinitions()
  2. 8.9.x core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php \Drupal\entity_test\Entity\EntityTestMulRevChanged::baseFieldDefinitions()
  3. 10 core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php \Drupal\entity_test\Entity\EntityTestMulRevChanged::baseFieldDefinitions()

Overrides EntityTestMulChanged::baseFieldDefinitions

1 call to EntityTestMulRevChanged::baseFieldDefinitions()
EntityTestMulRevChangedWithRevisionLog::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChangedWithRevisionLog.php
1 method overrides EntityTestMulRevChanged::baseFieldDefinitions()
EntityTestMulRevChangedWithRevisionLog::baseFieldDefinitions in core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChangedWithRevisionLog.php

File

core/modules/system/tests/modules/entity_test/src/Entity/EntityTestMulRevChanged.php, line 55

Class

EntityTestMulRevChanged
Defines the test entity class.

Namespace

Drupal\entity_test\Entity

Code

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);
    $fields['revision_id'] = BaseFieldDefinition::create('integer')->setLabel(t('Revision ID'))
        ->setDescription(t('The version id of the test entity.'))
        ->setReadOnly(TRUE)
        ->setSetting('unsigned', TRUE);
    $fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')->setLabel(t('Revision translation affected'))
        ->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
        ->setReadOnly(TRUE)
        ->setRevisionable(TRUE)
        ->setTranslatable(TRUE);
    $fields['langcode']->setRevisionable(TRUE);
    $fields['name']->setRevisionable(TRUE);
    $fields['user_id']->setRevisionable(TRUE);
    $fields['changed']->setRevisionable(TRUE);
    $fields['not_translatable']->setRevisionable(TRUE);
    return $fields;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.