Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / system / tests / modules / entity_test / src / Entity / EntityTestComputedField.php
index c873ccc00e293819d5d962007b414ff3c10ab1fb..187effe50456af380502707ad682b24c8ab9abc5 100644 (file)
@@ -4,6 +4,7 @@ namespace Drupal\entity_test\Entity;
 
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
+use Drupal\entity_test\Plugin\Field\ComputedReferenceTestFieldItemList;
 use Drupal\entity_test\Plugin\Field\ComputedTestFieldItemList;
 
 /**
@@ -39,6 +40,12 @@ class EntityTestComputedField extends EntityTest {
       ->setComputed(TRUE)
       ->setClass(ComputedTestFieldItemList::class);
 
+    $fields['computed_reference_field'] = BaseFieldDefinition::create('entity_reference')
+      ->setLabel('Computed Reference Field Test')
+      ->setComputed(TRUE)
+      ->setSetting('target_type', 'entity_test')
+      ->setClass(ComputedReferenceTestFieldItemList::class);
+
     return $fields;
   }