Commit | Line | Data |
0caaf4c3 |
1 | package SQL::Translator::Schema::Graph::Edge; |
2 | |
3 | use strict; |
4 | |
ba506e52 |
5 | use vars qw[ $VERSION ]; |
6 | $VERSION = '1.60'; |
7 | |
0caaf4c3 |
8 | use Class::MakeMethods::Template::Hash ( |
ba506e52 |
9 | new => ['new'], |
10 | scalar => [qw( type )], |
11 | array => [qw( traversals )], |
12 | object => [ |
13 | 'thisfield' => { class => 'SQL::Translator::Schema::Field' }, #FIXME |
14 | 'thatfield' => { class => 'SQL::Translator::Schema::Field' }, #FIXME |
15 | 'thisnode' => { class => 'SQL::Translator::Schema::Graph::Node' }, |
16 | 'thatnode' => { class => 'SQL::Translator::Schema::Graph::Node' }, |
0caaf4c3 |
17 | |
ba506e52 |
18 | ], |
0caaf4c3 |
19 | ); |
20 | |
21 | sub flip { |
ba506e52 |
22 | my $self = shift; |
65157eda |
23 | |
ba506e52 |
24 | return SQL::Translator::Schema::Graph::Edge->new( |
25 | thisfield => $self->thatfield, |
26 | thatfield => $self->thisfield, |
27 | thisnode => $self->thatnode, |
28 | thatnode => $self->thisnode, |
29 | type => $self->type eq 'import' ? 'export' : 'import' |
30 | ); |
0caaf4c3 |
31 | } |
32 | |
33 | 1; |