NOBUG: Improved docs for concat functions within mysql_native_moodle_database.php

This commit is contained in:
Sam Hemelryk 2010-11-11 01:57:35 +00:00
parent 9fc9de91be
commit 215d7cb84e

View File

@ -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);