You are here

private function EntityUpdateService::doFieldUpdate in Entity Construction Kit (ECK) 8

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 EntityUpdateService::doFieldUpdate()
EntityUpdateService::applyUpdates in src/EntityUpdateService.php
Applies all the detected valid changes.

File

src/EntityUpdateService.php, line 176

Class

EntityUpdateService
Class to update entity and field storage for ECK entities.

Namespace

Drupal\eck

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;
  }
}