basic pod stubs for everything but the CDBI compat layer.
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / SQL / OrderBy.pm
CommitLineData
b8e1e21f 1package DBIx::Class::SQL::OrderBy;
2
3use strict;
4use warnings;
5
6sub _cond_resolve {
7 my ($self, $cond, $attrs, @rest) = @_;
8 return $self->NEXT::ACTUAL::_cond_resolve($cond, $attrs, @rest)
9 unless wantarray;
10 my ($sql, @bind) = $self->NEXT::ACTUAL::_cond_resolve($cond, $attrs, @rest);
11 if ($attrs->{order_by}) {
12 $sql .= " ORDER BY ".join(', ', (ref $attrs->{order_by} eq 'ARRAY'
13 ? @{$attrs->{order_by}}
14 : $attrs->{order_by}));
15 }
16 return ($sql, @bind);
17}
18
191;
34d52be2 20
21=head1 NAME
22
23DBIx::Class::SQL::OrderBy - Implements sorting for DBIC's SQL backend
24
25=head1 SYNOPSIS
26
27=head1 DESCRIPTION
28
29This class implements the order_by attribute to L<DBIx::Class>'s search
30builder.
31
32=cut
33
34=head1 AUTHORS
35
36Matt S. Trout <perl-stuff@trout.me.uk>
37
38=head1 LICENSE
39
40You may distribute this code under the same terms as Perl itself.
41
42=cut