public function CommentActivityActionHandler::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 NodeActivityActionHandler::listEids
File
- ./
activity_action_handlers.inc, line 705
Class
- CommentActivityActionHandler
- Activity handler for the comment module. Extends the node handler has it presents a lot of the same things, just more.
Code
public function listEids($offset, $limit) {
$types = array_filter($this->options['types']);
$query = db_select('comment', 'c')
->fields('c', array(
'cid',
), 'eid');
if (!empty($types)) {
$node_alias = $query
->join('node', 'n', 'n.nid = c.nid');
$query
->condition($node_alias . '.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,
);
}