DBIx::MoCo::Join - Base class for joined DBIx::MoCo classes.
package Blog::BookmarkEntry; use base qw(DBIx::MoCo::Join Blog::Bookmark Blog::Entry); __PACKAGE__->table('bookmark inner join entry using(entry_id)'); __PACKAGE__->has_a( entry => 'Blog::Entry', { key => 'entry_id' }, ); 1;
Then you can use this class for search etc...
my $bookmarks = Blog::BookmarkEntry->search( where => ['uri = ?', $uri], # search by entry's field ); print $bookmarks->first->title; # able to use Blog::Entry's method
DBIx::MoCo
Junya Kondo, <jkondo@hatena.com>
Copyright (C) Hatena Inc. All Rights Reserved.
This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.
To install DBIx::MoCo, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DBIx::MoCo
CPAN shell
perl -MCPAN -e shell install DBIx::MoCo
For more information on module installation, please visit the detailed CPAN module installation guide.