| 1 | |||
| 2 | package DBIx::Romani::Query::Select::Join; | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | |||
| 6 | sub new | ||
| 7 | { | ||
| 8 | my $class = shift; | ||
| 9 | my $args = shift; | ||
| 10 | |||
| 11 | my $type; | ||
| 12 | my $table_name; | ||
| 13 | my $on; | ||
| 14 | |||
| 15 | if ( ref($args) eq 'HASH' ) | ||
| 16 | { | ||
| 17 | $type = $args->{type}; | ||
| 18 | $table_name = $args->{table}; | ||
| 19 | $on = $args->{on}; | ||
| 20 | } | ||
| 21 | else | ||
| 22 | { | ||
| 23 | $type = $args; | ||
| 24 | $table_name = shift; | ||
| 25 | $on = shift; | ||
| 26 | } | ||
| 27 | |||
| 28 | my $self = { | ||
| 29 | type => $type, | ||
| 30 | table_name => $table_name, | ||
| 31 | on => $on, | ||
| 32 | }; | ||
| 33 | |||
| 34 | bless $self, $class; | ||
| 35 | return $self; | ||
| 36 | } | ||
| 37 | |||
| 38 | sub get_type { return shift->{type}; } | ||
| 39 | sub get_table { return shift->{table_name}; } | ||
| 40 | sub get_on { return shift->{on}; } | ||
| 41 | |||
| 42 | sub clone | ||
| 43 | { | ||
| 44 | my $self = shift; | ||
| 45 | |||
| 46 | my $args = { | ||
| 47 | type => $self->get_type(), | ||
| 48 | table => $self->get_table(), | ||
| 49 | on => $self->get_on() | ||
| 50 | }; | ||
| 51 | |||
| 52 | return DBIx::Romani::Query::Select::Join->new($args); | ||
| 53 | } | ||
| 54 | |||
| 55 | 1; | ||
| 56 |