You are here

public function FeaturesBundle::setAssignmentWeights in Features 8.4

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

Sets the weights of the assignment methods.

Parameters

array $assignments: An array keyed by assignment method_id with a numeric weight value.

Overrides FeaturesBundleInterface::setAssignmentWeights

See also

\Drupal\features\FeaturesBundleInterface::getAssignmentWeights()

File

src/Entity/FeaturesBundle.php, line 250

Class

FeaturesBundle
Defines a features bundle.

Namespace

Drupal\features\Entity

Code

public function setAssignmentWeights(array $assignments) {
  foreach ($this->assignments as $method_id => &$method) {
    if (isset($assignments[$method_id])) {
      $method['weight'] = $assignments[$method_id];
    }
  }
}