public static function Connection::sqlFunctionRand in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php \Drupal\Core\Database\Driver\sqlite\Connection::sqlFunctionRand()
SQLite compatibility implementation for the RAND() SQL function.
File
- core/
lib/ Drupal/ Core/ Database/ Driver/ sqlite/ Connection.php, line 316
Class
- Connection
- SQLite implementation of \Drupal\Core\Database\Connection.
Namespace
Drupal\Core\Database\Driver\sqliteCode
public static function sqlFunctionRand($seed = NULL) {
if (isset($seed)) {
mt_srand($seed);
}
return mt_rand() / mt_getrandmax();
}