You are here

public function FeaturesBundle::setAssignmentSettings in Features 8.4

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

Sets settings specific to an assignment method.

Parameters

string $method_id: The ID of an assignment method. If NULL, all $settings are given keyed by method_ID.

array $settings: An array of setting values.

Overrides FeaturesBundleInterface::setAssignmentSettings

See also

\Drupal\features\FeaturesBundleInterface::getAssignmentSettings()

File

src/Entity/FeaturesBundle.php, line 306

Class

FeaturesBundle
Defines a features bundle.

Namespace

Drupal\features\Entity

Code

public function setAssignmentSettings($method_id, array $settings) {
  if (isset($method_id)) {
    $this->assignments[$method_id] = $settings;
  }
  else {
    foreach ($settings as $method_id => $method_settings) {
      if (!empty($method_settings)) {
        $this
          ->setAssignmentSettings($method_id, $method_settings);
      }
    }
  }
  return $this;
}