From 215d7cb84e783b7bba2c7f46fd42ac74a11f63d0 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 11 Nov 2010 01:57:35 +0000 Subject: [PATCH] NOBUG: Improved docs for concat functions within mysql_native_moodle_database.php --- lib/dml/mysqli_native_moodle_database.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 8cdfe8620bc..643751864f7 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -1054,6 +1054,14 @@ class mysqli_native_moodle_database extends moodle_database { } } + /** + * Returns the proper SQL to do CONCAT between the elements passed + * Can take many parameters + * + * @param string $str,... 1 or more fields/strings to concat + * + * @return string The concat sql + */ public function sql_concat() { $arr = func_get_args(); $s = implode(', ', $arr); @@ -1063,6 +1071,14 @@ class mysqli_native_moodle_database extends moodle_database { return "CONCAT($s)"; } + /** + * Returns the proper SQL to do CONCAT between the elements passed + * with a given separator + * + * @param string $separator The string to use as the separator + * @param array $elements An array of items to concatenate + * @return string The concat SQL + */ public function sql_concat_join($separator="' '", $elements=array()) { $s = implode(', ', $elements);