You are here

function hook_views_natural_sort_queue_rebuild_data_count in Views Natural Sort 7.2

Used for a custom module to return a count for the data being re-indexed.

Parameters

array $entry_type: Array representing an entry type with an entity_type field pair. 'entry_type' - The type of the entity we are getting data that needs to be re-indexed from 'field' - The field that needs to be re-indexed. 'module' - string naming the module that manages indexing.

Return value

int Integer representing the total number of items we are re-indexing.

2 functions implement hook_views_natural_sort_queue_rebuild_data_count()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

views_natural_sort_text_field_views_natural_sort_queue_rebuild_data_count in ./views_natural_sort_text_field.module
Implements hook_views_natural_sort_queue_rebuild_data_count().
views_natural_sort_views_natural_sort_queue_rebuild_data_count in ./views_natural_sort.module
Implements hook_views_natural_sort_queue_rebuild_data_count().
1 invocation of hook_views_natural_sort_queue_rebuild_data_count()
views_natural_sort_rebuild_index in ./views_natural_sort.admin.inc
Batch API callback for rebuild_index.

File

./views_natural_sort.api.php, line 105
Hook Definition file for Views Natural Sort.

Code

function hook_views_natural_sort_queue_rebuild_data_count(array $entry_type) {
  if ($entry_type['entity_type'] != 'user' || $entry_type['field'] != 'book_favorites') {
    return 0;
  }
  $result = db_select('user', 'u')
    ->fields('u', array(
    'uid',
    'book_favorites',
  ))
    ->execute()
    ->rowCount();
  return $result;
}