10 |
is => 'rw', |
is => 'rw', |
11 |
isa => 'Str', |
isa => 'Str', |
12 |
required => 1, |
required => 1, |
13 |
default => 'Reblog', |
default => 'Reblog::Schema', |
14 |
); |
); |
15 |
|
|
16 |
has dsn => ( |
has dsn => ( |
20 |
default => 'DBI:mysql:database=reblog;host=127.0.0.1;port=13306', |
default => 'DBI:mysql:database=reblog;host=127.0.0.1;port=13306', |
21 |
); |
); |
22 |
|
|
23 |
has table => ( |
has result_set => ( |
24 |
is => 'rw', |
is => 'rw', |
25 |
isa => 'Str', |
isa => 'Str', |
26 |
required => 1, |
required => 1, |
63 |
$attrs->{ $_ } = $self->$_ foreach ( grep { $self->$_ } ( qw/page order_by/ ) ); |
$attrs->{ $_ } = $self->$_ foreach ( grep { $self->$_ } ( qw/page order_by/ ) ); |
64 |
warn "# attrs ", $self->dump( $attrs ); |
warn "# attrs ", $self->dump( $attrs ); |
65 |
|
|
66 |
|
my $rs = $schema->resultset( $self->result_set ) |
67 |
my $rs = $schema->resultset( $self->table ) |
->published |
68 |
# ->search( undef, $attrs ) |
->search( undef, $attrs ) |
69 |
|
; |
70 |
|
=for published |
71 |
->search({ |
->search({ |
72 |
'userdata.label' => 'published', |
'userdata.label' => 'published', |
73 |
'userdata.value_numeric' => 1, |
'userdata.value_numeric' => 1, |
74 |
}, { |
}, { |
75 |
join => [ 'userdata' ], |
join => [ 'userdata' ], |
76 |
%$attrs |
%$attrs, |
77 |
}) |
}) |
78 |
; |
; |
79 |
|
=cut |
80 |
|
|
81 |
my @rows; |
my @rows; |
82 |
my @name; |
my @name; |
108 |
} |
} |
109 |
} |
} |
110 |
|
|
111 |
|
=head1 SEE ALSO |
112 |
|
|
113 |
|
DBIx::Master Class |
114 |
|
|
115 |
|
L<http://www.shadowcat.co.uk/catalyst/-talks/yapc-na-2008/dbix-masterclass.xul> presentation |
116 |
|
|
117 |
|
L<http://www.shadowcat.co.uk/archive/conference-video/yapc-eu-2008/dbic-masterclass/> video |
118 |
|
|
119 |
|
=cut |
120 |
|
|
121 |
1; |
1; |