function CommentController::buildQuery

Overrides DrupalDefaultEntityController::buildQuery

File

modules/comment/comment.module, line 1711

Class

CommentController
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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.