You are here

public function CustomEntityDefinitionUpdateManager::getChangeList in Entity Update 2.0.x

Gets a list of changes to entity type and field storage definitions.

Return value

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 only the DEFINITION_UPDATED value.
  • field_storage_definitions: an associative array keyed by field name of scalars having one value among:

    • DEFINITION_CREATED
    • DEFINITION_UPDATED
    • DEFINITION_DELETED

File

src/CustomEntityDefinitionUpdateManager.php, line 223

Class

CustomEntityDefinitionUpdateManager
Development version of the entity definition update manager.

Namespace

Drupal\entity_update

Code

public function getChangeList() {

  // Ensure this works also on Drupal 8.6 and earlier.
  $reflector = new \ReflectionMethod($this->entityDefinitionUpdateManager, 'getChangeList');
  $reflector
    ->setAccessible(TRUE);
  $complete_change_list = $reflector
    ->invoke($this->entityDefinitionUpdateManager);
  if ($complete_change_list) {

    // EntityDefinitionUpdateManagerInterface::getChangeList() only disables
    // the cache and does not invalidate. In case there are changes,
    // explicitly invalidate caches.
    $this->entityTypeManager
      ->clearCachedDefinitions();
    $this->entityFieldManager
      ->clearCachedFieldDefinitions();
  }
  return $complete_change_list;
}