You are here

public function NodeActivityActionHandler::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

1 method overrides NodeActivityActionHandler::listEids()
CommentActivityActionHandler::listEids in ./activity_action_handlers.inc
List all eids for this handler, used for batch regeneration and backfilling.

File

./activity_action_handlers.inc, line 559

Class

NodeActivityActionHandler
Activity handler for node module.

Code

public function listEids($offset, $limit) {
  $types = array_filter($this->options['types']);

  // Because the op view currently isn't batchable, it can be skipped.
  $query = db_select('node', 'n')
    ->fields('n', array(
    'nid',
  ), 'eid');
  if (!empty($types)) {
    $query
      ->condition('type', $types, 'IN');
  }
  $count_query = clone $query;
  $total = $count_query
    ->countQuery()
    ->execute()
    ->fetchField();
  $query
    ->range($offset, $limit);
  $arguments = array();
  foreach ($query
    ->execute()
    ->fetchCol() as $eid) {
    $arguments[$eid] = array(
      'argument1' => NULL,
      'argument2' => NULL,
    );
  }
  return array(
    'total' => $total,
    'arguments' => $arguments,
  );
}