Filter undef from all constructor args
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Schema / Graph / Edge.pm
CommitLineData
e3fc8761 1package # hide from pause
2 SQL::Translator::Schema::Graph::Edge;
0caaf4c3 3
4use strict;
f27f9229 5use warnings;
0caaf4c3 6
7use Class::MakeMethods::Template::Hash (
11ad2df9 8 new => ['new'],
9 scalar => [ qw( type ) ],
10 array => [ qw( traversals ) ],
11 object => [
ea93df61 12 'thisfield' => {class => 'SQL::Translator::Schema::Field'}, #FIXME
13 'thatfield' => {class => 'SQL::Translator::Schema::Field'}, #FIXME
14 'thisnode' => {class => 'SQL::Translator::Schema::Graph::Node'},
15 'thatnode' => {class => 'SQL::Translator::Schema::Graph::Node'},
0caaf4c3 16
ea93df61 17 ],
0caaf4c3 18);
19
20sub flip {
11ad2df9 21 my $self = shift;
22
23#warn "self thisfield: ".$self->thisfield->name;
24#warn "self thatfield: ".$self->thatfield->name;
65157eda 25
11ad2df9 26 return SQL::Translator::Schema::Graph::Edge->new( thisfield => $self->thatfield,
ea93df61 27 thatfield => $self->thisfield,
28 thisnode => $self->thatnode,
29 thatnode => $self->thisnode,
30 type => $self->type eq 'import' ? 'export' : 'import'
31 );
0caaf4c3 32}
33
341;