DBIx::Class::LookupColumn - A dbic component for building accessors for a lookup table.
Version 0.01
__PACKAGE__->load_components( qw/+DBIx::Class::LookupColumn/ );
__PACKAGE__->table("user");
__PACKAGE__->add_columns(
"user_id", { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, "first_name", { data_type => "varchar2", is_nullable => 0, size => 45 }, "last_name", { data_type => "varchar2", is_nullable => 0, size => 45 }, "permission_type_id", { data_type => "integer", is_nullable => 0 }, );
__PACKAGE__->set_primary_key("user_id");
__PACKAGE__->add_lookup( 'permission', 'permission_type_id', 'PermissionType' );
This module generates a few convenient methods (accessors) for accessing data in a lookup table from an associated belongs_to table. It plays with DBIx::Class::LookupColumn::Manager.
What is meant as lookup table is a table containing some terms definition, such as PermissionType (permission_id, name) with such data (1, 'Administrator'; 2, 'User'; 3, 'Reader') associated with a client table (also called target table) such as User, whose metas might look like this : (id, first_name, last_name, permission_id).
add_lookup
Karl Forner <karl.forner@gmail.com>
Please report any bugs or feature requests to bug-dbix-class-lookupcolumn at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=DBIx-Class-LookupColumn. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-dbix-class-lookupcolumn at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc DBIx::Class::LookupColumn
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=DBIx-Class-LookupColumn
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/DBIx-Class-LookupColumn
CPAN Ratings
http://cpanratings.perl.org/d/DBIx-Class-LookupColumn
Search CPAN
http://search.cpan.org/dist/DBIx-Class-LookupColumn/
Copyright 2012 Karl Forner, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the terms as Perl itself.
To install DBIx::Class::LookupColumn, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::Class::LookupColumn
CPAN shell
perl -MCPAN -e shell install DBIx::Class::LookupColumn
For more information on module installation, please visit the detailed CPAN module installation guide.