doFieldUpdate example

$this->doEntityUpdate($change_list['entity_type']$entity_type_id);
      }

      // Process field storage definition changes.       if (!empty($change_list['field_storage_definitions'])) {
        $storage_definitions = \Drupal::service('entity_field.manager')->getFieldStorageDefinitions($entity_type_id);
        $original_storage_definitions = \Drupal::service('entity.last_installed_schema.repository')->getLastInstalledFieldStorageDefinitions($entity_type_id);

        foreach ($change_list['field_storage_definitions'] as $field_name => $change) {
          $storage_definition = $storage_definitions[$field_name] ?? NULL;
          $original_storage_definition = $original_storage_definitions[$field_name] ?? NULL;
          $this->doFieldUpdate($change$storage_definition$original_storage_definition);
        }
      }
    }
  }

  /** * Performs an entity type definition update. * * @param string $op * The operation to perform, either static::DEFINITION_CREATED or * static::DEFINITION_UPDATED. * @param string $entity_type_id * The entity type ID. */
Home | Imprint | This part of the site doesn't use cookies.