You are here

public function views_handler_field_node::init in Views (for Drupal 7) 7.3

Same name and namespace in other branches
  1. 6.3 modules/node/views_handler_field_node.inc \views_handler_field_node::init()

Init the handler with necessary data.

Parameters

view $view: The $view object this handler is attached to.

array $options: The item from the database; the actual contents of this will vary based upon the type of handler.

Overrides views_handler_field::init

2 calls to views_handler_field_node::init()
views_handler_field_history_user_timestamp::init in modules/node/views_handler_field_history_user_timestamp.inc
Init the handler with necessary data.
views_handler_field_node_revision::init in modules/node/views_handler_field_node_revision.inc
Init the handler with necessary data.
2 methods override views_handler_field_node::init()
views_handler_field_history_user_timestamp::init in modules/node/views_handler_field_history_user_timestamp.inc
Init the handler with necessary data.
views_handler_field_node_revision::init in modules/node/views_handler_field_node_revision.inc
Init the handler with necessary data.

File

modules/node/views_handler_field_node.inc, line 22
Definition of views_handler_field_node.

Class

views_handler_field_node
Field handler to provide simple renderer that allows linking to a node.

Code

public function init(&$view, &$options) {
  parent::init($view, $options);

  // Don't add the additional fields to groupby.
  if (!empty($this->options['link_to_node'])) {
    $this->additional_fields['nid'] = array(
      'table' => 'node',
      'field' => 'nid',
    );
    if (module_exists('translation')) {
      $this->additional_fields['language'] = array(
        'table' => 'node',
        'field' => 'language',
      );
    }
  }
}