Class::DBI::DataMigration Getting Your Data From There to Here #27

How It Works: How a Migrator Migrates

From Class::DBI::DataMigration::Migrator:

sub migrate_objects {
   my ($self, $to_migrate) = @_;

   # iterate through the list referred to by 
   # $to_migrate, mapping each object as we go:

   my @migrated = ();
   foreach my $obj (@$to_migrate) {
       my $newobj = $self->map($obj); # will create a target db object and return it
                                      # or return an error string
       confess $newobj unless (ref($newobj));
       push @migrated, $newobj;
   }

   return \@migrated;
}
Copyright © 2005 Dan Friedman (Powered by Spork)