1 views_handler_relationship_node_term_data.inc views_handler_relationship_node_term_data::init(&$view, &$options)

Init handler to let relationships live on tables other than the table they operate on.

Overrides views_handler_relationship::init

File

core/modules/taxonomy/views/views_handler_relationship_node_term_data.inc, line 14
Definition of views_handler_relationship_node_term_data.

Class

views_handler_relationship_node_term_data
Relationship handler to return the taxonomy terms of nodes.

Code

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

  // Convert legacy vids option to machine name vocabularies.
  if (!empty($this->options['vids'])) {
    $vocabularies = taxonomy_vocabulary_load_multiple(FALSE);
    foreach ($this->options['vids'] as $vid) {
      if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
        $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
      }
    }
  }
}