You are here

public function FeaturesBundle::getAssignmentSettings in Features 8.4

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

Gets settings specific to an assignment method.

Parameters

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

Return value

array An array of settings. Format specific to assignment method.

Overrides FeaturesBundleInterface::getAssignmentSettings

See also

\Drupal\features\FeaturesBundleInterface::setAssignmentSettings()

1 call to FeaturesBundle::getAssignmentSettings()
FeaturesBundle::setEnabledAssignments in src/Entity/FeaturesBundle.php
Sets the list of enabled assignment methods.

File

src/Entity/FeaturesBundle.php, line 284

Class

FeaturesBundle
Defines a features bundle.

Namespace

Drupal\features\Entity

Code

public function getAssignmentSettings($method_id = NULL) {
  if (isset($method_id)) {
    if (isset($this->assignments[$method_id])) {
      return $this->assignments[$method_id];
    }
    else {

      // Use defaults.
      return $this
        ->getDefaultSettings($method_id);
    }
  }
  else {
    $list = [];
    foreach (array_keys($this->assignments) as $method_id) {
      $list[$method_id] = $this
        ->getAssignmentSettings($method_id);
    }
    return $list;
  }
}