=head1 VERSION
-Version 0.999001
+Version 0.999003
=cut
-our $VERSION = '0.999001';
+our $VERSION = '0.999003';
=head1 NAME
# then somewhere else
- my $object_type_arrayref = $object_type_rs->limit(count => 3)->with_substr->display();
+ my $object_type_arrayref = $object_type_rs->with_substr->display();
# [{
# 'artistid' => '1',
return $self->_row_info->{$id};
}
-=head2 order_by (EXPERIMENTAL)
-
-=over 4
-
-=item Arguments: col => $column_name
-
-=item Return Value: ResultSet
-
-=back
-
- $ordered_rs = $rs->order_by(col => 'name');
-
-Convenience method. Essentually a shortcut for $rs->search({}, { order_by => $col }).
-
-=cut
-
-method order_by (%opts) {
- my $col = $opts{col};
- $col = "me.$col" unless ($col =~ m/\./);
- return $self->search({}, { order_by => $col });
-}
-
-=head2 limit (EXPERIMENTAL)
-
-=over 4
-
-=item Arguments: count => Int
-
-=item Return Value: ResultSet
-
-=back
-
- $limitted_rs = $rs->limit(count => 3);
-
-Convenience method. Essentually a shortcut for $rs->search({}, { rows => $count }).
-
-=cut
-
-method limit (%opts) {
- my $count = $opts{count};
- return $self->search({}, { rows => $count });
-}
-
method _mk_id (%opts) {
my $row = $opts{row};
return join('-', map { $row->{$_} } @{$self->id_cols});
ok(my $schema = DBICTest->init_schema(), 'got schema');
{
- my $artist_rs = $schema->resultset('Artist')->order_by(col => 'artistid')->display();
+ my $artist_rs = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->display();
is_deeply($artist_rs, [
{
'artistid' => '1',
}
{
- my $artists = $schema->resultset('Artist')->order_by(col => 'artistid')->with_substr->display();
+ my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr->display();
is_deeply($artists, [
{
'artistid' => '1',
}
{
- my $artists = $schema->resultset('Artist')->order_by(col => 'artistid')->with_substr->search({}, { prefetch => 'cds', rows => 1 })->display();
+ my $artists = $schema->resultset('Artist')->search({}, { order_by => 'artistid' })->with_substr->search({}, { prefetch => 'cds', rows => 1 })->display();
is_deeply($artists, [
{
'artistid' => 1,