function database_test_odd_pager_query
Run a pager query and return the results.
This function does care about the page GET parameter, as set by the simpletest HTTP call.
1 string reference to 'database_test_odd_pager_query'
- database_test_menu in modules/
simpletest/ tests/ database_test.module - Implements hook_menu().
File
-
modules/
simpletest/ tests/ database_test.module, line 122
Code
function database_test_odd_pager_query($limit) {
$query = db_select('test_task', 't');
$query->fields('t', array(
'task',
))
->orderBy('pid');
// This should result in 4 pages of results.
$query = $query->extend('PagerDefault')
->limit($limit);
$names = $query->execute()
->fetchCol();
drupal_json_output(array(
'names' => $names,
));
exit;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.