You are here

public function OgVocabMigrate::preImport in OG Vocabulary 7

Add the OG-vocab field to the bundle.

Overrides Migration::preImport

File

includes/migrate/og_vocab.migrate.inc, line 100
Migrate plugin to populate the OG vocabulary field by the term references.

Class

OgVocabMigrate
@file Migrate plugin to populate the OG vocabulary field by the term references.

Code

public function preImport() {
  $bundle = $this->bundle;

  // Add OG-vocab field to bundle.
  if (!field_info_instance('node', OG_VOCAB_FIELD, $bundle)) {
    og_create_field(OG_VOCAB_FIELD, 'node', $bundle);
    self::displayMessage(t('Added "OG vocabulary" field to @bundle content-type.', array(
      '@bundle' => $bundle,
    )), 'success');
  }
}