Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion Custom orderBy with FIELD

View Parsed - Show only message text

Received: by 10.90.49.3 with SMTP id w3mr190489agw.2.1247100811138;
        Wed, 08 Jul 2009 17:53:31 -0700 (PDT)
Return-Path: <jphi...@noatak.com>
Received: from sidik.uaf.edu (sidik.uaf.edu [137.229.5.242])
        by gmr-mx.google.com with ESMTP id 20si845501yxe.3.2009.07.08.17.53.30;
        Wed, 08 Jul 2009 17:53:31 -0700 (PDT)
Received-SPF: neutral (google.com: 137.229.5.242 is neither permitted nor denied by best guess record for domain of jphi...@noatak.com) client-ip=137.229.5.242;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 137.229.5.242 is neither permitted nor denied by best guess record for domain of jphi...@noatak.com) smtp.mail=jphi...@noatak.com
Received: from fnjbpd2 (fnjbp-d2.iab.uaf.edu [137.229.80.225])
	by sidik.uaf.edu (8.13.8/8.13.8/uaf3) with ESMTP id n690rwOc014604
	for <doctrine-user@googlegroups.com>; Wed, 8 Jul 2009 16:54:05 -0800
From: "J.Philip" <jphi...@noatak.com>
To: <doctrine-user@googlegroups.com>
References: <40275916-834d-4b64-af19-1589226faf6a@t11g2000prh.googlegroups.com>
In-Reply-To: <40275916-834d-4b64-af19-1589226faf6a@t11g2000prh.googlegroups.com>
Subject: RE: [doctrine-user] Custom orderBy with FIELD
Date: Wed, 8 Jul 2009 16:53:15 -0800
Message-ID: <00fb01ca002f$a9d40db0$fd7c2910$@com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Mailer: Microsoft Office Outlook 12.0
Thread-Index: AcoALuhX4zPSPaYyTl6CLGutpwlGSgAAKhvQ
Content-Language: en-us

You can do this in Doctrine with a RawSql query.


-----Original Message-----
From: doctrine-user@googlegroups.com [mailto:doctrine-user@googlegroups.com]
On Behalf Of conankun
Sent: Wednesday, July 08, 2009 4:48 PM
To: doctrine-user
Subject: [doctrine-user] Custom orderBy with FIELD


Hi,

I would like to know if it's possible to do a custom orderBy with
Doctrine? In other words, is there any Doctrine equivalent to this
SQL:

SELECT * FROM `table` ORDER BY FIELD(id,2,5,3,6,4,1);

I know I can do a normal Doctrine_Query and traverse the results array
and do manual sorting (which is my current alternative), however it
would be good if I can just grab the custom sorted data straight from
the SQL (since MySQL also supports this).

If it's currently not possible, I hope it will be added in the future,
thx.

PS: Let me know if this suppose to be a support ticket or something.

Cheers,
HC




Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google