You are here

private function DevelEntityDefinitionUpdateManager::doFieldUpdate in Devel Entity Updates 3.x

Same name and namespace in other branches
  1. 8.2 src/DevelEntityDefinitionUpdateManager.php \Drupal\devel_entity_updates\DevelEntityDefinitionUpdateManager::doFieldUpdate()
  2. 8 src/DevelEntityDefinitionUpdateManager.php \Drupal\devel_entity_updates\DevelEntityDefinitionUpdateManager::doFieldUpdate()
  3. 3.0.x src/DevelEntityDefinitionUpdateManager.php \Drupal\devel_entity_updates\DevelEntityDefinitionUpdateManager::doFieldUpdate()

Performs a field storage definition update.

Parameters

string $op: The operation to perform, possible values are:

\Drupal\Core\Field\FieldStorageDefinitionInterface|null $storage_definition: (optional) The new field storage definition. Defaults to none.

\Drupal\Core\Field\FieldStorageDefinitionInterface|null $original_storage_definition: (optional) The original field storage definition. Defaults to none.

1 call to DevelEntityDefinitionUpdateManager::doFieldUpdate()
DevelEntityDefinitionUpdateManager::applyUpdates in src/DevelEntityDefinitionUpdateManager.php
Applies all the detected valid changes.

File

src/DevelEntityDefinitionUpdateManager.php, line 191

Class

DevelEntityDefinitionUpdateManager
Development version of the entity definition update manager.

Namespace

Drupal\devel_entity_updates

Code

private function doFieldUpdate($op, FieldStorageDefinitionInterface $storage_definition = NULL, FieldStorageDefinitionInterface $original_storage_definition = NULL) {
  switch ($op) {
    case EntityDefinitionUpdateManagerInterface::DEFINITION_CREATED:
      $this->fieldStorageDefinitionListener
        ->onFieldStorageDefinitionCreate($storage_definition);
      break;
    case EntityDefinitionUpdateManagerInterface::DEFINITION_UPDATED:
      if ($storage_definition && $original_storage_definition) {
        $this->fieldStorageDefinitionListener
          ->onFieldStorageDefinitionUpdate($storage_definition, $original_storage_definition);
      }
      break;
    case EntityDefinitionUpdateManagerInterface::DEFINITION_DELETED:
      if ($original_storage_definition) {
        $this->fieldStorageDefinitionListener
          ->onFieldStorageDefinitionDelete($original_storage_definition);
      }
      break;
  }
}