You are here

protected function PluginBase::setOptionDefaults in Views (for Drupal 7) 8.3

14 calls to PluginBase::setOptionDefaults()
AccessPluginBase::init in lib/Drupal/views/Plugin/views/access/AccessPluginBase.php
Initialize the plugin.
AreaPluginBase::init in lib/Drupal/views/Plugin/views/area/AreaPluginBase.php
Overrides Drupal\views\Plugin\views\HandlerBase::init().
ArgumentDefaultPluginBase::init in 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 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 lib/Drupal/views/Plugin/views/cache/CachePluginBase.php
Initialize the plugin.

... See full list

File

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;
    }
  }
}