MoCo/Join.pm

filter: Statementstmt 100% 12 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 7 / 7 Podpod 75.0% 3 / 4 totaltotal 95.6% 22 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« MoCo/MUID.pm ↑ Summary
1 package DBIx::MoCo::Join;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use base qw(DBIx::MoCo::Readonly);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶sub primary_keys {[]}
Subroutine primary_keys: called CC=1 SCAR=0.0
Pod documented
7 1 ▶sub unique_keys {[]}
Subroutine unique_keys: called CC=1 SCAR=0.0
Pod documented
8 1 ▶sub cache {}
Subroutine cache: called CC=1 SCAR=0.0
Pod undocumented
9 2 ▶sub columns {}
Subroutine columns: called CC=1 SCAR=0.0
Pod documented
10  
11 1 1;
12  
13 =head1 NAME
14  
15 DBIx::MoCo::Join - Base class for joined DBIx::MoCo classes.
16  
17 =head1 SYNOPSIS
18  
19 package Blog::BookmarkEntry;
20 use base qw(DBIx::MoCo::Join Blog::Bookmark Blog::Entry);
21  
22 __PACKAGE__->table('bookmark inner join entry using(entry_id)');
23 __PACKAGE__->has_a(
24 entry => 'Blog::Entry',
25 { key => 'entry_id' },
26 );
27  
28 1;
29  
30 Then you can use this class for search etc...
31  
32 my $bookmarks = Blog::BookmarkEntry->search(
33 where => ['uri = ?', $uri], # search by entry's field
34 );
35 print $bookmarks->first->title; # able to use Blog::Entry's method
36  
37 =head1 SEE ALSO
38  
39 L<DBIx::MoCo>
40  
41 =head1 AUTHOR
42  
43 Junya Kondo, E<lt>jkondo@hatena.comE<gt>
44  
45 =head1 COPYRIGHT AND LICENSE
46  
47 Copyright (C) Hatena Inc. All Rights Reserved.
48  
49 This library is free software; you may redistribute it and/or modify
50 it under the same terms as Perl itself.
51  
52 =cut
« MoCo/MUID.pm ↑ Summary