You are here

function tft_update_8002 in Taxonomy File Tree 8

Creates the tft_members field in the tft_file.

File

./tft.install, line 33
Install, update and uninstall functions for the TFT module.

Code

function tft_update_8002() {
  $config_path = drupal_get_path('module', 'tft') . '/config/optional';
  $storage = new FileStorage($config_path);
  $data = $storage
    ->read('field.storage.media.tft_members');
  if (!FieldStorageConfig::loadByName($data['entity_type'], $data['field_name'])) {
    FieldStorageConfig::create($data)
      ->save();
  }
  $data = $storage
    ->read('field.field.media.tft_file.tft_members');
  if (!FieldConfig::loadByName($data['entity_type'], $data['bundle'], $data['field_name'])) {
    FieldConfig::create($data)
      ->save();
  }
}