comparison core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManagerInterface.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
78 * human-readable strings, each describing a change. 78 * human-readable strings, each describing a change.
79 */ 79 */
80 public function getChangeSummary(); 80 public function getChangeSummary();
81 81
82 /** 82 /**
83 * Gets a list of changes to entity type and field storage definitions.
84 *
85 * @return array
86 * An associative array keyed by entity type ID of change descriptors. Every
87 * entry is an associative array with the following optional keys:
88 * - entity_type: a scalar having one value among:
89 * - EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED
90 * - EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED
91 * - field_storage_definitions: an associative array keyed by field name of
92 * scalars having one value among:
93 * - EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED
94 * - EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED
95 * - EntityDefinitionUpdateManagerInterface::DEFINITION_DELETED
96 */
97 public function getChangeList();
98
99 /**
83 * Applies all the detected valid changes. 100 * Applies all the detected valid changes.
84 * 101 *
85 * Use this with care, as it will apply updates for any module, which will 102 * Use this with care, as it will apply updates for any module, which will
86 * lead to unpredictable results. 103 * lead to unpredictable results.
87 * 104 *
88 * @throws \Drupal\Core\Entity\EntityStorageException 105 * @throws \Drupal\Core\Entity\EntityStorageException
89 * This exception is thrown if a change cannot be applied without 106 * This exception is thrown if a change cannot be applied without
90 * unacceptable data loss. In such a case, the site administrator needs to 107 * unacceptable data loss. In such a case, the site administrator needs to
91 * apply some other process, such as a custom update function or a 108 * apply some other process, such as a custom update function or a
92 * migration via the Migrate module. 109 * migration via the Migrate module.
110 *
111 * @deprecated in Drupal 8.7.0, will be removed before Drupal 9.0.0. Use
112 * \Drupal\Core\Entity\EntityDefinitionUpdateManagerInterface::getChangeList()
113 * and execute each entity type and field storage update manually instead.
114 *
115 * @see https://www.drupal.org/node/3034742
93 */ 116 */
94 public function applyUpdates(); 117 public function applyUpdates();
95 118
96 /** 119 /**
97 * Returns an entity type definition ready to be manipulated. 120 * Returns an entity type definition ready to be manipulated.
141 * 164 *
142 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type 165 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
143 * The entity type definition. 166 * The entity type definition.
144 */ 167 */
145 public function uninstallEntityType(EntityTypeInterface $entity_type); 168 public function uninstallEntityType(EntityTypeInterface $entity_type);
169
170 /**
171 * Applies any change performed to a fieldable entity type definition.
172 *
173 * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
174 * The updated entity type definition.
175 * @param \Drupal\Core\Field\FieldStorageDefinitionInterface[] $field_storage_definitions
176 * The updated field storage definitions, including possibly new ones.
177 * @param array &$sandbox
178 * (optional) A sandbox array provided by a hook_update_N() implementation
179 * or a Batch API callback. If the entity schema update requires a data
180 * migration, this parameter is mandatory. Defaults to NULL.
181 */
182 public function updateFieldableEntityType(EntityTypeInterface $entity_type, array $field_storage_definitions, array &$sandbox = NULL);
146 183
147 /** 184 /**
148 * Returns a field storage definition ready to be manipulated. 185 * Returns a field storage definition ready to be manipulated.
149 * 186 *
150 * When needing to apply updates to existing field storage definitions, this 187 * When needing to apply updates to existing field storage definitions, this