mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-11 18:32:32 +01:00
Merge pull request #22819 from noec764/14_FIX_getNextValue
FIX: GetNextValue() adding regexsql() function
This commit is contained in:
@@ -757,6 +757,24 @@ class DoliDBPgsql extends DoliDB
|
||||
return '(CASE WHEN '.$test.' THEN '.$resok.' ELSE '.$resko.' END)';
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a SQL REGEXP
|
||||
*
|
||||
* @param string $subject string tested
|
||||
* @param string $pattern SQL pattern to match
|
||||
* @param string $sqlstring whether or not the string being tested is an SQL expression
|
||||
* @return string SQL string
|
||||
*/
|
||||
public function regexpsql($subject, $pattern, $sqlstring = false)
|
||||
{
|
||||
if ($sqlstring) {
|
||||
return "(". $subject ." ~ '" . $pattern . "')";
|
||||
}
|
||||
|
||||
return "('". $subject ."' ~ '" . $pattern . "')";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Renvoie le code erreur generique de l'operation precedente.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user