From 47595f9a4a4f4ee903e6ac02d64b9b5b5b6bf191 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Barrois?= Date: Tue, 16 Feb 2010 11:33:00 +0100 Subject: [PATCH] Add XDB::formatCustomOrder (to create a custom order in an SQL query) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Raphaël Barrois --- classes/xdb.php | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- 2.1.4