function views_handler::init

3.x handlers.inc views_handler::init(&$view, &$options)
2.x handlers.inc views_handler::init(&$view, $options)

init the handler with necessary data.

Parameters

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

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

4 calls to views_handler::init()
views_handler_argument::init in handlers/views_handler_argument.inc
init the handler with necessary data.
views_handler_field::init in handlers/views_handler_field.inc
init the handler with necessary data.
views_handler_filter::init in handlers/views_handler_filter.inc
Provide some extra help to get the operator/value easier to use.
views_handler_relationship::init in handlers/views_handler_relationship.inc
Init handler to let relationships live on tables other than the table they operate on.
4 methods override views_handler::init()
views_handler_argument::init in handlers/views_handler_argument.inc
init the handler with necessary data.
views_handler_field::init in handlers/views_handler_field.inc
init the handler with necessary data.
views_handler_filter::init in handlers/views_handler_filter.inc
Provide some extra help to get the operator/value easier to use.
views_handler_relationship::init in handlers/views_handler_relationship.inc
Init handler to let relationships live on tables other than the table they operate on.

File

includes/handlers.inc, line 237
handlers.inc Defines the various handler objects to help build and display views.

Class

views_handler
Base handler, from which all the other handlers are derived. It creates a common interface to create consistency amongst handlers and data.

Code

function init(&$view, $options) {
  $this->view = &$view;
  $this->unpack_options($this->options, $options);

  // This exist on most handlers, but not all. So they are still optional.
  if (isset($options['table'])) {
    $this->table = $options['table'];
  }

  if (isset($this->definition['real field'])) {
    $this->real_field = $this->definition['real field'];
  }

  if (isset($this->definition['field'])) {
    $this->real_field = $this->definition['field'];
  }

  if (isset($options['field'])) {
    $this->field = $options['field'];
    if (!isset($this->real_field)) {
      $this->real_field = $options['field'];
    }
  }

  $this->query = &$view->query;
}