protected function PluginBase::setOptionDefaults

14 calls to PluginBase::setOptionDefaults()
AccessPluginBase::init in drupal/core/modules/views/lib/Drupal/views/Plugin/views/access/AccessPluginBase.php
Initialize the plugin.
AreaPluginBase::init in drupal/core/modules/views/lib/Drupal/views/Plugin/views/area/AreaPluginBase.php
Overrides Drupal\views\Plugin\views\HandlerBase::init().
ArgumentDefaultPluginBase::init in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument_default/ArgumentDefaultPluginBase.php
Initialize this plugin with the view and the argument it is linked to.
ArgumentValidatorPluginBase::init in drupal/core/modules/views/lib/Drupal/views/Plugin/views/argument_validator/ArgumentValidatorPluginBase.php
Initialize this plugin with the view and the argument it is linked to.
CachePluginBase::init in drupal/core/modules/views/lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
Initialize the plugin.

... See full list

File

drupal/core/modules/views/lib/Drupal/views/Plugin/views/PluginBase.php, line 82
Definition of Drupal\views\Plugin\views\PluginBase.

Class

PluginBase

Namespace

Drupal\views\Plugin\views

Code

protected function setOptionDefaults(&$storage, $options, $level = 0) {
  foreach ($options as $option => $definition) {
    if (isset($definition['contains']) && is_array($definition['contains'])) {
      $storage[$option] = array();
      $this
        ->setOptionDefaults($storage[$option], $definition['contains'], $level++);
    }
    elseif (!empty($definition['translatable']) && !empty($definition['default'])) {
      $storage[$option] = t($definition['default']);
    }
    else {
      $storage[$option] = isset($definition['default']) ? $definition['default'] : NULL;
    }
  }
}