RE: retrieve_all method to support order_by
[prev]
[thread]
[next]
[Date index for 2005/02/23]
Thank you, Jonathan.
Would it be better to support the same 'order_by' syntax as 'search' and
'search_like' methods without a plug-in? :)
john
> -----Original Message-----
> From: Jonathan Tweed [mailto:jonathan@xxxxx.xxxx]
> Sent: Wednesday, February 23, 2005 12:16 PM
> To: cdbi-talk@xxxxxx.xxxxx.xxx
> Subject: Re: retrieve_all method to support order_by
>=20
> Have a look at Class::DBI::Plugin::RetrieveAll
>=20
> Jonathan
>=20
> On 23 Feb 2005, at 20:10, Zhuang Li wrote:
>=20
> > 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 =3D> <<'');
> > SELECT __ESSENTIAL__
> > FROM __TABLE__
> > %s
> >
> > sub retrieve_all {
> > my ($class, $arg) =3D @_;
> >
> > 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
> >
>=20
|
(message missing)
|
|
|
RE: retrieve_all method to support order_by
Zhuang Li 22:32 on 23 Feb 2005
|