You are here

protected function FeaturesExportForm::addUnpackaged in Features 8.3

Same name and namespace in other branches
  1. 8.4 modules/features_ui/src/Form/FeaturesExportForm.php \Drupal\features_ui\Form\FeaturesExportForm::addUnpackaged()

Adds a pseudo-package to display unpackaged configuration.

Parameters

array $packages: An array of package names.

\Drupal\features\ConfigurationItem[] $config_collection: A collection of configuration.

1 call to FeaturesExportForm::addUnpackaged()
FeaturesExportForm::buildForm in modules/features_ui/src/Form/FeaturesExportForm.php
Form constructor.

File

modules/features_ui/src/Form/FeaturesExportForm.php, line 503

Class

FeaturesExportForm
Defines the configuration export form.

Namespace

Drupal\features_ui\Form

Code

protected function addUnpackaged(array &$packages, array $config_collection) {
  $packages['unpackaged'] = new Package('unpackaged', [
    'name' => $this
      ->t('Unpackaged'),
    'description' => $this
      ->t('Configuration that has not been added to any package.'),
    'config' => [],
    'status' => FeaturesManagerInterface::STATUS_NO_EXPORT,
    'version' => '',
  ]);
  foreach ($config_collection as $item_name => $item) {
    if (!$item
      ->getPackage() && !$item
      ->isExcluded() && !$item
      ->isProviderExcluded()) {
      $packages['unpackaged']
        ->appendConfig($item_name);
    }
  }
}