You are here

function content_handler_field_multiple::init in Brightcove Video Connect 6

Same name and namespace in other branches
  1. 6.2 brightcove_cck/views/content_handler_field_multiple.inc \content_handler_field_multiple::init()
3 calls to content_handler_field_multiple::init()
brightcove_cck_handler_field_video::init in brightcove_cck/views/brightcove_cck_handler_field_video.inc
brightcove_cck_handler_field_video_date::init in brightcove_cck/views/brightcove_cck_handler_field_video_date.inc
brightcove_cck_handler_field_video_tags::init in brightcove_cck/views/brightcove_cck_handler_field_video_tags.inc
3 methods override content_handler_field_multiple::init()
brightcove_cck_handler_field_video::init in brightcove_cck/views/brightcove_cck_handler_field_video.inc
brightcove_cck_handler_field_video_date::init in brightcove_cck/views/brightcove_cck_handler_field_video_date.inc
brightcove_cck_handler_field_video_tags::init in brightcove_cck/views/brightcove_cck_handler_field_video_tags.inc

File

brightcove_cck/views/content_handler_field_multiple.inc, line 13
An extended subclass for field handling that adds multiple field grouping.

Class

content_handler_field_multiple
@file An extended subclass for field handling that adds multiple field grouping.

Code

function init(&$view, $options) {
  $field = $this->content_field;
  parent::init($view, $options);
  $this->defer_query = !empty($options['multiple']['group']) && $field['multiple'];
  if ($this->defer_query) {

    // Grouped field: ditch the existing additional_fields (field columns + delta).
    // In the main query we'll only need:
    // - vid, which will be used to retrieve the actual values in pre_render,
    // - node type and nid, which wil be used in the pseudo-node used when
    // rendering.
    $this->additional_fields = array(
      'type' => array(
        'table' => 'node',
        'field' => 'type',
      ),
      'nid' => array(
        'table' => 'node',
        'field' => 'nid',
      ),
    );
    if ($view->base_table == 'node_revisions') {
      $this->additional_fields['vid'] = array(
        'table' => 'node_revisions',
        'field' => 'vid',
      );
    }
    else {
      $this->additional_fields['vid'] = array(
        'table' => 'node',
        'field' => 'vid',
      );
    }
  }
}