SPOPS::Export::DBI::Data - Export SPOPS objects as data for importing directly into a DBI table


SPOPS documentation Contained in the SPOPS distribution.

Index


Code Index:

NAME

Top

SPOPS::Export::DBI::Data - Export SPOPS objects as data for importing directly into a DBI table

SYNOPSIS

Top

 # See SPOPS::Export

DESCRIPTION

Top

Implement raw DBI data output for SPOPS::Export. This is almost exactly like SPOPS::Export::Object except we export the table name instead of the object class.

Output from this should be usable by SPOPS::Import::DBI::Data.

METHODS

Top

create_header( \@fields )

Same as the parent, but add the table name in the header.

BUGS

Top

None known.

TO DO

Top

Nothing known.

SEE ALSO

Top

SPOPS::Import::DBI::Data

COPYRIGHT

Top

AUTHORS

Top

Chris Winters <chris@cwinters.com>


SPOPS documentation Contained in the SPOPS distribution.

package SPOPS::Export::DBI::Data;

# $Id: Data.pm,v 3.3 2004/06/02 00:48:22 lachoy Exp $

use strict;
use base qw( SPOPS::Export::Object );

$SPOPS::Export::DBI::Data::VERSION  = sprintf("%d.%02d", q$Revision: 3.3 $ =~ /(\d+)\.(\d+)/);

sub create_header {
    my ( $self, $fields ) = @_;
    my $table = $self->object_class->table_name;
    my $field_names_show = join ' ', @{ $fields };
    return join( "\n", '$item = [',
                       "  { table => '$table',",
                       "    field_order => [ qw/ $field_names_show / ] },\n" );
}

1;

__END__