public function TaxonomyIndexTid::init in Zircon Profile 8
Same name in this branch
- 8 core/modules/taxonomy/src/Plugin/views/filter/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\filter\TaxonomyIndexTid::init()
- 8 core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\field\TaxonomyIndexTid::init()
Same name and namespace in other branches
- 8.0 core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php \Drupal\taxonomy\Plugin\views\field\TaxonomyIndexTid::init()
Initialize the plugin.
Parameters
\Drupal\views\ViewExecutable $view: The view object.
\Drupal\views\Plugin\views\display\DisplayPluginBase $display: The display handler.
array $options: The options configured for this plugin.
Overrides FieldPluginBase::init
File
- core/
modules/ taxonomy/ src/ Plugin/ views/ field/ TaxonomyIndexTid.php, line 65 - Contains \Drupal\taxonomy\Plugin\views\field\TaxonomyIndexTid.
Class
- TaxonomyIndexTid
- Field handler to display all taxonomy terms of a node.
Namespace
Drupal\taxonomy\Plugin\views\fieldCode
public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
parent::init($view, $display, $options);
// @todo: Wouldn't it be possible to use $this->base_table and no if here?
if ($view->storage
->get('base_table') == 'node_field_revision') {
$this->additional_fields['nid'] = array(
'table' => 'node_field_revision',
'field' => 'nid',
);
}
else {
$this->additional_fields['nid'] = array(
'table' => 'node_field_data',
'field' => 'nid',
);
}
}