function StubConnection::queryRange

Same name and namespace in other branches
  1. 8.9.x core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php \Drupal\Tests\Core\Database\Stub\StubConnection::queryRange()
  2. 10 core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php \Drupal\Tests\Core\Database\Stub\StubConnection::queryRange()
  3. 11.x core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php \Drupal\Tests\Core\Database\Stub\StubConnection::queryRange()

Runs a limited-range query on this database object.

Use this as a substitute for ->query() when a subset of the query is to be returned. User-supplied arguments to the query should be passed in as separate parameters so that they can be properly escaped to avoid SQL injection attacks.

Parameters

string $query: A string containing an SQL query.

int $from: The first result row to return.

int $count: The maximum number of result rows to return.

array $args: (optional) An array of values to substitute into the query at placeholder markers.

array $options: (optional) An array of options on the query.

Return value

\Drupal\Core\Database\StatementInterface A database query result resource, or NULL if the query was not executed correctly.

Overrides Connection::queryRange

File

core/tests/Drupal/Tests/Core/Database/Stub/StubConnection.php, line 65

Class

StubConnection
A stub of the abstract Connection class for testing purposes.

Namespace

Drupal\Tests\Core\Database\Stub

Code

public function queryRange($query, $from, $count, array $args = [], array $options = []) {
    return NULL;
}

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