diff core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManagerInterface.php @ 18:af1871eacc83

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:33:08 +0100
parents 129ea1e6d783
children
line wrap: on
line diff
--- a/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManagerInterface.php	Thu Feb 28 13:21:36 2019 +0000
+++ b/core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManagerInterface.php	Thu May 09 15:33:08 2019 +0100
@@ -80,6 +80,23 @@
   public function getChangeSummary();
 
   /**
+   * Gets a list of changes to entity type and field storage definitions.
+   *
+   * @return array
+   *   An associative array keyed by entity type ID of change descriptors. Every
+   *   entry is an associative array with the following optional keys:
+   *   - entity_type: a scalar having one value among:
+   *     - EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED
+   *     - EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED
+   *   - field_storage_definitions: an associative array keyed by field name of
+   *     scalars having one value among:
+   *     - EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED
+   *     - EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED
+   *     - EntityDefinitionUpdateManagerInterface::DEFINITION_DELETED
+   */
+  public function getChangeList();
+
+  /**
    * Applies all the detected valid changes.
    *
    * Use this with care, as it will apply updates for any module, which will
@@ -90,6 +107,12 @@
    *   unacceptable data loss. In such a case, the site administrator needs to
    *   apply some other process, such as a custom update function or a
    *   migration via the Migrate module.
+   *
+   * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. Use
+   *    \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::getChangeList()
+   *    and execute each entity type and field storage update manually instead.
+   *
+   * @see https://www.drupal.org/node/3034742
    */
   public function applyUpdates();
 
@@ -145,6 +168,20 @@
   public function uninstallEntityType(EntityTypeInterface $entity_type);
 
   /**
+   * Applies any change performed to a fieldable entity type definition.
+   *
+   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
+   *   The updated entity type definition.
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $field_storage_definitions
+   *   The updated field storage definitions, including possibly new ones.
+   * @param array &$sandbox
+   *   (optional) A sandbox array provided by a hook_update_N() implementation
+   *   or a Batch API callback. If the entity schema update requires a data
+   *   migration, this parameter is mandatory. Defaults to NULL.
+   */
+  public function updateFieldableEntityType(EntityTypeInterface $entity_type, array $field_storage_definitions, array &$sandbox = NULL);
+
+  /**
    * Returns a field storage definition ready to be manipulated.
    *
    * When needing to apply updates to existing field storage definitions, this