You are here

protected function FeaturesCommands::featuresOptions in Features 8.4

Same name and namespace in other branches
  1. 8.3 src/Commands/FeaturesCommands.php \Drupal\features\Commands\FeaturesCommands::featuresOptions()

Applies global options for Features drush commands, including the bundle.

The option --name="bundle_name" sets the bundle namespace.

Return value

\Drupal\features\FeaturesAssignerInterface The features.assigner with options applied.

8 calls to FeaturesCommands::featuresOptions()
FeaturesCommands::add in src/Commands/FeaturesCommands.php
Add a config item to a feature package.
FeaturesCommands::components in src/Commands/FeaturesCommands.php
List features components.
FeaturesCommands::diff in src/Commands/FeaturesCommands.php
Show the difference between active|default config from a feature package.
FeaturesCommands::export in src/Commands/FeaturesCommands.php
Export the configuration on your site into a custom module.
FeaturesCommands::import in src/Commands/FeaturesCommands.php
Import a module config into your site.

... See full list

File

src/Commands/FeaturesCommands.php, line 130

Class

FeaturesCommands
Drush commands for Features.

Namespace

Drupal\features\Commands

Code

protected function featuresOptions(array $options) {
  $bundleName = $this
    ->getOption($options, 'bundle');
  if (!empty($bundleName)) {
    $bundle = $this->assigner
      ->applyBundle($bundleName);
    if ($bundle
      ->getMachineName() !== $bundleName) {
      $this
        ->logger()
        ->warning('Bundle {name} not found. Using default.', [
        'name' => $bundleName,
      ]);
    }
  }
  else {
    $this->assigner
      ->assignConfigPackages();
  }
  return $this->assigner;
}