本文整理汇总了PHP中Drupal\views\Plugin\views\HandlerBase::init方法的典型用法代码示例。如果您正苦于以下问题:PHP HandlerBase::init方法的具体用法?PHP HandlerBase::init怎么用?PHP HandlerBase::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drupal\views\Plugin\views\HandlerBase
的用法示例。
在下文中一共展示了HandlerBase::init方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* 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;
}
}
示例2: init
/**
* 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'];
}
}
示例3: init
/**
* 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'] = '';
}
}
示例4: init
/**
* 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'];
}
}
示例5: init
/**
* 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;
}
}