/** * Overrides Drupal\views\Plugin\views\HandlerBase::init(). * * Make sure that no result area handlers are set to be shown when the result * is empty. */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); if ($this->areaType == 'empty') { $this->options['empty'] = TRUE; } }
/** * Overrides Drupal\views\Plugin\views\HandlerBase:init(). */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); if (!empty($this->definition['name field'])) { $this->name_field = $this->definition['name field']; } if (!empty($this->definition['name table'])) { $this->name_table = $this->definition['name table']; } }
/** * Overrides Drupal\views\Plugin\views\HandlerBase::init(). */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); $this->additional_fields = array(); if (!empty($this->definition['additional fields'])) { $this->additional_fields = $this->definition['additional fields']; } if (!isset($this->options['exclude'])) { $this->options['exclude'] = ''; } }
/** * Overrides \Drupal\views\Plugin\views\HandlerBase::init(). * * Init handler to let relationships live on tables other than * the table they operate on. */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); if (isset($this->definition['relationship table'])) { $this->table = $this->definition['relationship table']; } if (isset($this->definition['relationship field'])) { // Set both realField and field so custom handler can rely on the old // field value. $this->realField = $this->field = $this->definition['relationship field']; } }
/** * Overrides \Drupal\views\Plugin\views\HandlerBase::init(). * * Provide some extra help to get the operator/value easier to use. * * This likely has to be overridden by filters which are more complex * than simple operator/value. */ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) { parent::init($view, $display, $options); $this->operator = $this->options['operator']; $this->value = $this->options['value']; $this->group_info = $this->options['group_info']['default_group']; // Set the default value of the operator ID. if (!empty($options['exposed']) && !empty($options['expose']['operator']) && !isset($options['expose']['operator_id'])) { $this->options['expose']['operator_id'] = $options['expose']['operator']; } if ($this->multipleExposedInput()) { $this->group_info = array_filter($options['group_info']['default_group_multiple']); $this->options['expose']['multiple'] = TRUE; } // If there are relationships in the view, allow empty should be true // so that we can do IS NULL checks on items. Not all filters respect // allow empty, but string and numeric do and that covers enough. if ($this->view->display_handler->getOption('relationships')) { $this->definition['allow empty'] = TRUE; } }