mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
NOBUG: Improved docs for concat functions within mysql_native_moodle_database.php
This commit is contained in:
parent
9fc9de91be
commit
215d7cb84e
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user