You are here

public function UserActivityActionHandler::listEids in Activity 7

List all eids for this handler, used for batch regeneration and backfilling.

Parameters

int $offset: The offset for the query.

int $limit: The limit for the query.

Overrides ActivityActionHandler::listEids

File

./activity_action_handlers.inc, line 892

Class

UserActivityActionHandler
Activity Action Handler for the user triggers.

Code

public function listEids($offset, $limit) {
  $roles = array_filter($this->options['roles']);
  $query = db_select('users', 'u')
    ->fields('u', array(
    'uid',
  ), 'eid')
    ->condition('u.uid', 0, '<>')
    ->range($offset, $limit);
  if (!empty($roles)) {
    $roles_alias = $query
      ->join('users_roles', 'r', 'r.uid = u.uid');
    $query
      ->condition($roles_alias . '.rid', $roles, 'IN');
  }
  $count_query = clone $query;
  $total = $count_query
    ->countQuery()
    ->execute()
    ->fetchField();
  $arguments = array();
  foreach ($query
    ->execute()
    ->fetchCol() as $eid) {
    $arguments[$eid] = array(
      'argument1' => NULL,
      'argument2' => NULL,
    );
  }
  return array(
    'total' => $total,
    'arguments' => $arguments,
  );
}