2 |
use Moose; |
use Moose; |
3 |
|
|
4 |
extends 'Frey'; |
extends 'Frey'; |
5 |
with 'Frey::Web'; |
with 'Frey::Web', 'Frey::Config'; |
|
with 'Frey::Config'; |
|
|
#with 'Frey::Storage'; |
|
6 |
|
|
7 |
has dbic_class => ( |
has dbic_class => ( |
8 |
is => 'rw', |
is => 'rw', |
9 |
isa => 'Str', |
isa => 'Str', |
10 |
requried => 1, |
required => 1, |
11 |
default => 'Reblog', |
default => 'Reblog::Schema', |
12 |
); |
); |
13 |
|
|
14 |
has dsn => ( |
has dsn => ( |
18 |
default => 'DBI:mysql:database=reblog;host=127.0.0.1;port=13306', |
default => 'DBI:mysql:database=reblog;host=127.0.0.1;port=13306', |
19 |
); |
); |
20 |
|
|
21 |
has table => ( |
has result_set => ( |
22 |
is => 'rw', |
is => 'rw', |
23 |
isa => 'Str', |
isa => 'Str', |
24 |
required => 1, |
required => 1, |
61 |
$attrs->{ $_ } = $self->$_ foreach ( grep { $self->$_ } ( qw/page order_by/ ) ); |
$attrs->{ $_ } = $self->$_ foreach ( grep { $self->$_ } ( qw/page order_by/ ) ); |
62 |
warn "# attrs ", $self->dump( $attrs ); |
warn "# attrs ", $self->dump( $attrs ); |
63 |
|
|
64 |
|
my $rs = $schema->resultset( $self->result_set ) |
65 |
my $rs = $schema->resultset( $self->table ) |
->published |
66 |
# ->search( undef, $attrs ) |
->search( undef, $attrs ) |
67 |
|
; |
68 |
|
=for published |
69 |
->search({ |
->search({ |
70 |
'userdata.label' => 'published', |
'userdata.label' => 'published', |
71 |
'userdata.value_numeric' => 1, |
'userdata.value_numeric' => 1, |
72 |
}, { |
}, { |
73 |
join => [ 'userdata' ], |
join => [ 'userdata' ], |
74 |
%$attrs |
%$attrs, |
75 |
}) |
}) |
76 |
; |
; |
77 |
|
=cut |
78 |
|
|
79 |
my @rows; |
my @rows; |
80 |
my @name; |
my @name; |
106 |
} |
} |
107 |
} |
} |
108 |
|
|
109 |
|
=head1 SEE ALSO |
110 |
|
|
111 |
|
DBIx::Master Class |
112 |
|
|
113 |
|
L<http://www.shadowcat.co.uk/catalyst/-talks/yapc-na-2008/dbix-masterclass.xul> presentation |
114 |
|
|
115 |
|
L<http://www.shadowcat.co.uk/archive/conference-video/yapc-eu-2008/dbic-masterclass/> video |
116 |
|
|
117 |
|
=cut |
118 |
|
|
119 |
|
__PACKAGE__->meta->make_immutable; |
120 |
|
no Moose; |
121 |
|
|
122 |
1; |
1; |