Producer::Turnkey obsolete. now rely on TTSchema parser (see concommitant
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Schema / Graph / Edge.pm
CommitLineData
0caaf4c3 1package SQL::Translator::Schema::Graph::Edge;
2
3use strict;
4
5use Class::MakeMethods::Template::Hash (
6 new => ['new'],
7 scalar => [ qw( type ) ],
8 array => [ qw( traversals ) ],
9 object => [
10 'thisfield' => {class => 'SQL::Translator::Schema::Field'}, #FIXME
11 'thatfield' => {class => 'SQL::Translator::Schema::Field'}, #FIXME
12 'thisnode' => {class => 'SQL::Translator::Schema::Graph::Node'},
13 'thatnode' => {class => 'SQL::Translator::Schema::Graph::Node'},
14
15 ],
16);
17
18sub flip {
19 my $self = shift;
65157eda 20
21#warn "self thisfield: ".$self->thisfield->name;
22#warn "self thatfield: ".$self->thatfield->name;
23
0caaf4c3 24 return SQL::Translator::Schema::Graph::Edge->new( thisfield => $self->thatfield,
25 thatfield => $self->thisfield,
26 thisnode => $self->thatnode,
27 thatnode => $self->thisnode,
28 type => $self->type eq 'import' ? 'export' : 'import'
29 );
30}
31
321;