You are here

public function FeaturesAssigner::getBundleList in Features 8.3

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

Returns an array of all existing features bundles.

Return value

\Drupal\features\FeaturesBundleInterface[] Keyed by machine_name with value of \Drupal\features\FeaturesBundleInterface.

Overrides FeaturesAssignerInterface::getBundleList

4 calls to FeaturesAssigner::getBundleList()
FeaturesAssigner::createBundlesFromPackages in src/FeaturesAssigner.php
Creates bundles by parsing information from installed packages.
FeaturesAssigner::findBundleByName in src/FeaturesAssigner.php
Returns a named bundle.
FeaturesAssigner::getBundleOptions in src/FeaturesAssigner.php
Returns an array of bundle names suitable for a select option list.
FeaturesAssigner::__construct in src/FeaturesAssigner.php
Constructs a new FeaturesAssigner object.

File

src/FeaturesAssigner.php, line 272

Class

FeaturesAssigner
Class responsible for performing package assignment.

Namespace

Drupal\features

Code

public function getBundleList() {
  if (empty($this->bundles)) {
    $this->bundles = [];
    foreach ($this->entityTypeManager
      ->getStorage('features_bundle')
      ->loadMultiple() as $machine_name => $bundle) {
      $this->bundles[$machine_name] = $bundle;
    }
  }
  return $this->bundles;
}