From: Raphaël Barrois Date: Tue, 16 Feb 2010 10:33:00 +0000 (+0100) Subject: Add XDB::formatCustomOrder (to create a custom order in an SQL query) X-Git-Tag: core/1.1.0~81 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=47595f9a4a4f4ee903e6ac02d64b9b5b5b6bf191;p=platal.git Add XDB::formatCustomOrder (to create a custom order in an SQL query) Signed-off-by: Raphaël Barrois --- diff --git a/classes/xdb.php b/classes/xdb.php index 829941c..1df0fff 100644 --- a/classes/xdb.php +++ b/classes/xdb.php @@ -181,6 +181,12 @@ class XDB } } + // Returns a FIELD(blah, 3, 1, 2) for use in an order with custom orders + public static function formatCustomOrder($field, $values) + { + return 'FIELD( ' . $field . ', ' . XDB::formatArray($values) . ')'; + } + public static function execute() { global $globals;