You are here

protected function FeaturesBundle::getDefaultSettings in Features 8.3

Same name and namespace in other branches
  1. 8.4 src/Entity/FeaturesBundle.php \Drupal\features\Entity\FeaturesBundle::getDefaultSettings()

Return array of default settings for the given plugin method.

Parameters

$method_id:

Return value

array

1 call to FeaturesBundle::getDefaultSettings()
FeaturesBundle::getAssignmentSettings in src/Entity/FeaturesBundle.php
Gets settings specific to an assignment method.

File

src/Entity/FeaturesBundle.php, line 265

Class

FeaturesBundle
Defines a features bundle.

Namespace

Drupal\features\Entity

Code

protected function getDefaultSettings($method_id) {
  $settings = [
    'enabled' => FALSE,
    'weight' => 0,
  ];
  $manager = \Drupal::service('plugin.manager.features_assignment_method');
  $definition = $manager
    ->getDefinition($method_id);
  if (isset($definition['weight'])) {
    $settings['weight'] = $definition['weight'];
  }
  if (isset($definition['default_settings'])) {
    $settings += $definition['default_settings'];
  }
  return $settings;
}