本文整理匯總了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;
}
}