You are here

function views_handler_field_node_registration_available_slots::init in Node registration 7

Initialize the entity type.

Overrides views_handler_field_entity::init

File

includes/views/views_handler_field_node_registration_available_slots.inc, line 10

Class

views_handler_field_node_registration_available_slots
@file

Code

function init(&$view, &$options) {
  parent::init($view, $options);
  $this->view
    ->init_style();
  $this->additional_fields['nid'] = 'nid';
  $handler_name = 'registration_used_slots';
  $field_handlers =& $this->view->display_handler->handlers['field'];
  $fields = $this->view->display_handler
    ->get_option('fields');
  if (!isset($fields[$handler_name])) {

    // Create, init and attach handler.
    $handler = views_get_handler($this->table, $handler_name, 'field');
    $handler_options = array(
      'id' => $handler_name,
      'table' => $this->table,
      'field' => $handler_name,
      'label' => 'AUTOMATIC',
      'exclude' => TRUE,
    );
    $handler->main_field = $options['id'];
    $handler
      ->init($view, $handler_options);
    $field_handlers[$handler_name] = $handler;

    // Create and attach fake field.
    $fields[$handler_name] = $handler_options;
    $this->view->display_handler
      ->set_option('fields', $fields);
  }
}