You are here

public function VocabularyConfigurationHandler::onFieldBaseLoad in Configuration Management 7.3

File

src/Handlers/VocabularyConfigurationHandler.php, line 83

Class

VocabularyConfigurationHandler

Namespace

Configuration\Handlers

Code

public function onFieldBaseLoad($event) {
  $field = $event->configuration
    ->getData();
  if ($field['type'] == 'taxonomy_term_reference' && !empty($field['settings']['allowed_values'])) {
    foreach ($field['settings']['allowed_values'] as $vocabulary) {
      $this->configuration_manager
        ->newDependency($event->configuration, 'vocabulary.' . $vocabulary['vocabulary']);
    }
  }
}