# NEVER EDIT this file.  It was generated and will be overwritten without
# notice upon regeneration of this application.  You have been warned.
package Contact::Model::author_book;
use strict; use warnings;

__PACKAGE__->load_components( qw/ PK::Auto Core / );
__PACKAGE__->table( 'author_book' );
__PACKAGE__->add_columns( qw/
    id
    author
    book
    extra_field
    second_extra
/ );
__PACKAGE__->set_primary_key( 'id' );
__PACKAGE__->base_model( 'Contact::Model' );
__PACKAGE__->belongs_to( author => 'Contact::Model::author' );
__PACKAGE__->belongs_to( book => 'Contact::Model::book' );

sub get_foreign_display_fields {
    return [ qw(  ) ];
}

sub get_foreign_tables {
    return qw(
    );
}

sub foreign_display {
    my $self = shift;

}

sub table_name {
    return 'author_book';
}

my %select_map_for = (
    extra_field => {
        happy => 'Happy',
        sad => 'Sad',
    },
    second_extra => {
        1 => 'Yes',
        2 => 'No',
    },
);

sub extra_field_display {
    my $self = shift;
    return $select_map_for{ extra_field }{ $self->extra_field }
           || $self->extra_field;
}

sub second_extra_display {
    my $self = shift;
    return $select_map_for{ second_extra }{ $self->second_extra }
           || $self->second_extra;
}

1;

=head1 NAME

Contact::Model::GEN::author_book - model for author_book table (generated part)

=head1 DESCRIPTION

This model inherits from Gantry::Utils::DBIxClass.
It was generated by Bigtop, and IS subject to regeneration.

=head1 METHODS

You may use all normal Gantry::Utils::DBIxClass methods and the
ones listed here:

=over 4

=item get_foreign_display_fields

=item get_foreign_tables

=item foreign_display

=item table_name

=item extra_field_display

=item second_extra_display

=back

=cut
