You are here

public static function Connection::sqlFunctionRand in Drupal 10

SQLite compatibility implementation for the RAND() SQL function.

File

core/modules/sqlite/src/Driver/Database/sqlite/Connection.php, line 311

Class

Connection
SQLite implementation of \Drupal\Core\Database\Connection.

Namespace

Drupal\sqlite\Driver\Database\sqlite

Code

public static function sqlFunctionRand($seed = NULL) {
  if (isset($seed)) {
    mt_srand($seed);
  }
  return mt_rand() / mt_getrandmax();
}