Re: retrieve_all method to support order_by
[prev]
[thread]
[next]
[Date index for 2005/02/23]
Have a look at Class::DBI::Plugin::RetrieveAll
Jonathan
On 23 Feb 2005, at 20:10, Zhuang Li wrote:
> Is there any reason why retrieve_all method doesn't support 'ORDER BY'
> clause? Will it be in future release?
>
> I have patched our system with:
>
> __PACKAGE__->set_sql(RetrieveAll => <<'');
> SELECT __ESSENTIAL__
> FROM __TABLE__
> %s
>
> sub retrieve_all {
> my ($class, $arg) = @_;
>
> if (ref $arg eq "HASH" && $arg->{order_by}) {
> return $class->sth_to_objects($class->sql_RetrieveAll(" ORDER
> BY
> $arg->{order_by}"));
> } else {
> return $class->sth_to_objects('RetrieveAll');
> }
> }
>
>
>
>
> john
>
 |
(message missing)
|