Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Entity / EntityLastInstalledSchemaRepository.php
index 61300125c9948380f37491974bf0cc91005f8629..70e552c742ff4ead98756d5d936c25d8fa0d9b7e 100644 (file)
@@ -34,6 +34,28 @@ class EntityLastInstalledSchemaRepository implements EntityLastInstalledSchemaRe
     return $this->keyValueFactory->get('entity.definitions.installed')->get($entity_type_id . '.entity_type');
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getLastInstalledDefinitions() {
+    $all_definitions = $this->keyValueFactory->get('entity.definitions.installed')->getAll();
+
+    // Filter out field storage definitions.
+    $filtered_keys = array_filter(array_keys($all_definitions), function ($key) {
+        return substr($key, -12) === '.entity_type';
+    });
+    $entity_type_definitions = array_intersect_key($all_definitions, array_flip($filtered_keys));
+
+    // Ensure that the returned array is keyed by the entity type ID.
+    $keys = array_keys($entity_type_definitions);
+    $keys = array_map(function ($key) {
+      $parts = explode('.', $key);
+      return $parts[0];
+    }, $keys);
+
+    return array_combine($keys, $entity_type_definitions);
+  }
+
   /**
    * {@inheritdoc}
    */