You are here

protected function EntityDefinitionUpdateManager::doFieldUpdate in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php \Drupal\Core\Entity\EntityDefinitionUpdateManager::doFieldUpdate()

Performs a field storage definition update.

Parameters

string $op: The operation to perform, possible values are static::DEFINITION_CREATED, static::DEFINITION_UPDATED or static::DEFINITION_DELETED.

array|null $storage_definition: The new field storage definition.

array|null $original_storage_definition: The original field storage definition.

1 call to EntityDefinitionUpdateManager::doFieldUpdate()
EntityDefinitionUpdateManager::applyUpdates in core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php
Applies all the detected valid changes.

File

core/lib/Drupal/Core/Entity/EntityDefinitionUpdateManager.php, line 237
Contains \Drupal\Core\Entity\EntityDefinitionUpdateManager.

Class

EntityDefinitionUpdateManager
Manages entity definition updates.

Namespace

Drupal\Core\Entity

Code

protected function doFieldUpdate($op, $storage_definition = NULL, $original_storage_definition = NULL) {
  switch ($op) {
    case static::DEFINITION_CREATED:
      $this->entityManager
        ->onFieldStorageDefinitionCreate($storage_definition);
      break;
    case static::DEFINITION_UPDATED:
      $this->entityManager
        ->onFieldStorageDefinitionUpdate($storage_definition, $original_storage_definition);
      break;
    case static::DEFINITION_DELETED:
      $this->entityManager
        ->onFieldStorageDefinitionDelete($original_storage_definition);
      break;
  }
}