/[Frey]/trunk/lib/A3C/HrEduOrg.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/A3C/HrEduOrg.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 106 - (hide annotations)
Sun Jul 13 12:22:14 2008 UTC (15 years, 9 months ago) by dpavlin
File size: 520 byte(s)
added Frey::Collection role to database models
1 dpavlin 102 package A3C::HrEduOrg;
2    
3     use A3C::Schema;
4     use Fey::ORM::Table;
5    
6     use Data::Dump qw/dump/;
7    
8 dpavlin 106 sub collection_table { 'hr_edu_orgs' }
9 dpavlin 102
10 dpavlin 106 my $table = A3C::Schema->Schema()->table( collection_table );
11    
12 dpavlin 102 has_table( $table );
13    
14     my $select = A3C::Schema->SQLFactoryClass()->new_select()
15     ->select( $table )
16     ->from( $table )
17     ->order_by( $table->column('id'), 'ASC' )
18     ->limit(10)
19     ;
20    
21 dpavlin 106 has_many 'first10' => (
22 dpavlin 102 table => $table,
23     select => $select,
24     );
25    
26     #warn dump( map { $_->name } $users_table->columns );
27    
28 dpavlin 106 with 'Frey::Collection';
29    
30 dpavlin 102 1;

  ViewVC Help
Powered by ViewVC 1.1.26