function Connection::sqlFunctionIf

Same name in other branches
  1. 9 core/modules/sqlite/src/Driver/Database/sqlite/Connection.php \Drupal\sqlite\Driver\Database\sqlite\Connection::sqlFunctionIf()
  2. 8.9.x core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php \Drupal\Core\Database\Driver\sqlite\Connection::sqlFunctionIf()
  3. 10 core/modules/sqlite/src/Driver/Database/sqlite/Connection.php \Drupal\sqlite\Driver\Database\sqlite\Connection::sqlFunctionIf()

SQLite compatibility implementation for the IF() SQL function.

File

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

Class

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

Namespace

Drupal\sqlite\Driver\Database\sqlite

Code

public static function sqlFunctionIf($condition, $expr1, $expr2 = NULL) {
    return $condition ? $expr1 : $expr2;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.