public function TripalImporter::load

3.x TripalImporter.inc public TripalImporter::load($import_id)

Loads an existing import record into this object.

Parameters

$import_id: The ID of the import record.

File

tripal/includes/TripalImporter.inc, line 356

Class

TripalImporter

Code

public function load($import_id) {
  $class = get_called_class();

  // Get the importer.
  $import = db_select('tripal_import', 'ti')
    ->fields('ti')
    ->condition('ti.import_id', $import_id)
    ->execute()
    ->fetchObject();

  if (!$import) {
    throw new Exception('Cannot find an importer that matches the given import ID.');
  }

  if ($import->class != $class) {
    throw new Exception('The importer specified by the given ID does not match this importer class.');
  }

  $this->arguments = unserialize($import->arguments);
  $this->import_id = $import_id;

}