You are here

public function FeaturesAssigner::setBundle in Features 8.4

Same name and namespace in other branches
  1. 8.3 src/FeaturesAssigner.php \Drupal\features\FeaturesAssigner::setBundle()

Stores a features bundle.

Added to list if machine_name is new.

Parameters

\Drupal\features\FeaturesBundleInterface $bundle: A features bundle.

bool $current: Determine if the current bundle is set to $bundle. If False, the current bundle is only updated if it already has the same machine name as the $bundle.

Overrides FeaturesAssignerInterface::setBundle

2 calls to FeaturesAssigner::setBundle()
FeaturesAssigner::createBundleFromDefault in src/FeaturesAssigner.php
Creates a new bundle by duplicating the default bundle and customizing.
FeaturesAssigner::renameBundle in src/FeaturesAssigner.php
Renames a bundle.

File

src/FeaturesAssigner.php, line 232

Class

FeaturesAssigner
Class responsible for performing package assignment.

Namespace

Drupal\features

Code

public function setBundle(FeaturesBundleInterface $bundle, $current = TRUE) {
  $this->bundles[$bundle
    ->getMachineName()] = $bundle;
  if (isset($this->currentBundle) && ($current || $bundle
    ->getMachineName() == $this->currentBundle
    ->getMachineName())) {
    $this->currentBundle = $bundle;
  }
}