1.20.x comment.entity.inc protected CommentStorageController::buildQuery($ids, $conditions = array(), $revision_id = FALSE)

Overrides EntityDatabaseStorageController::buildQuery().

Overrides DefaultEntityController::buildQuery

File

modules/comment/comment.entity.inc, line 228
Entity controller and class for comments.

Class

CommentStorageController
Defines the controller class for comments.

Code

protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE) {
  $query = parent::buildQuery($ids, $conditions, $revision_id);
  // Specify additional fields from the user and node tables.
  $query->innerJoin('node', 'n', 'base.nid = n.nid');
  $query->addField('n', 'type', 'node_type');
  $query->innerJoin('users', 'u', 'base.uid = u.uid');
  $query->addField('u', 'name', 'registered_name');
  $query->fields('u', array('uid', 'signature', 'signature_format', 'picture'));
  return $query;
}