/[Frey]/trunk/lib/Strix/User.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/Strix/User.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 991 - (hide annotations)
Sat Jan 10 23:29:38 2009 UTC (15 years, 4 months ago) by dpavlin
File size: 696 byte(s)
Frey::Class::Refactor::Modify Frey::Collection -> Frey::ORM::Collection
1 dpavlin 2 package Strix::User;
2    
3     use Strix::Schema;
4     use Fey::ORM::Table;
5    
6 dpavlin 4 use Data::Dump qw/dump/;
7 dpavlin 2
8 dpavlin 106 sub collection_table { 'users' }
9 dpavlin 4
10 dpavlin 106 my $users_table = Strix::Schema->Schema()->table( collection_table );
11    
12 dpavlin 57 has_table( $users_table );
13    
14     my $select =
15     Strix::Schema->SQLFactoryClass()->new_select()
16     ->select( $users_table )
17     ->from( $users_table )
18     # ->where( $users_table->column('parent_message_id'), '=', Fey::Placeholder->new() )
19 dpavlin 88 ->order_by( $users_table->column('id'), 'ASC' )
20 dpavlin 81 # ->limit(5)
21 dpavlin 57 ;
22    
23    
24 dpavlin 106 has_many 'foobar' => (
25 dpavlin 57 table => $users_table,
26     select => $select,
27     # bind_params => sub { $_[0]->message_id() },
28     );
29    
30 dpavlin 61 #warn dump( map { $_->name } $users_table->columns );
31    
32 dpavlin 991 with 'Frey::ORM::Collection';
33 dpavlin 106
34 dpavlin 4 1;

  ViewVC Help
Powered by ViewVC 1.1.26