You are here

public function MigrateDestinationBiblioType::import in Bibliography Module 7.3

Import a biblio type.

Parameters

$entity: Object object to build. Filled with any fields mapped in the Migration.

$row: Raw source data object - passed through to prepare/complete handlers.

Overrides MigrateDestination::import

File

includes/migrate/plugins/destinations/biblio_type.inc, line 43

Class

MigrateDestinationBiblioType
@file

Code

public function import(stdClass $entity, stdClass $row) {
  $this
    ->prepare($entity, $row);
  if (empty($entity->type)) {
    throw new MigrateException(t('Missing biblio type.'));
  }
  if (empty($entity->description)) {
    throw new MigrateException(t('Missing description.'));
  }

  // Save the type.
  biblio_type_save($entity);
  $this
    ->complete($entity, $row);
  return array(
    $entity->type,
  );
}