Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / src / Entity / EntityTestMulRev.php
index f01675f60256dcec5ba9ebbfc694b5511dc60e8b..b4493e31f885c7d6ac6d9f37a2b460bbab68b556 100644 (file)
@@ -2,6 +2,9 @@
 
 namespace Drupal\entity_test\Entity;
 
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Field\BaseFieldDefinition;
+
 /**
  * Defines the test entity class.
  *
@@ -47,4 +50,18 @@ namespace Drupal\entity_test\Entity;
  */
 class EntityTestMulRev extends EntityTestRev {
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
+    $fields = parent::baseFieldDefinitions($entity_type) + \Drupal::state()->get($entity_type->id() . '.additional_base_field_definitions', []);
+
+    $fields['non_mul_field'] = BaseFieldDefinition::create('string')
+      ->setLabel(t('Non translatable'))
+      ->setDescription(t('A non-translatable string field'))
+      ->setRevisionable(TRUE);
+
+    return $fields;
+  }
+
 }