You are here

public static function Notifications_Queue::queue_status in Notifications 6.4

Get queue status count grouping by some fields

File

includes/notifications_queue.class.inc, line 748

Class

Notifications_Queue
Queue management and processing

Code

public static function queue_status($fields) {
  $field_names = implode(', ', $fields);
  $result = db_query("SELECT {$field_names}, count(*) AS count FROM {notifications_queue} WHERE cron = 1 GROUP BY {$field_names}");

  // Get all rows and compile data
  $data = array();
  $count = 0;
  while ($item = db_fetch_object($result)) {
    $data[] = $item;
  }
  return $data;
}