You are here

protected function FeaturesAssignmentExisting::safeAssignConfig in Features 8.3

Same name and namespace in other branches
  1. 8.4 src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php \Drupal\features\Plugin\FeaturesAssignment\FeaturesAssignmentExisting::safeAssignConfig()

Calls assignConfigPackage without allowing exceptions to abort us.

Parameters

string $machine_name: Machine name of package.

\Drupal\Core\Extension\Extension $extension: An Extension object.

1 call to FeaturesAssignmentExisting::safeAssignConfig()
FeaturesAssignmentExisting::assignPackages in src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php
Performs package assignment.

File

src/Plugin/FeaturesAssignment/FeaturesAssignmentExisting.php, line 29

Class

FeaturesAssignmentExisting
Class for assigning existing modules to packages.

Namespace

Drupal\features\Plugin\FeaturesAssignment

Code

protected function safeAssignConfig($machine_name, Extension $extension) {
  $config = $this->featuresManager
    ->listExtensionConfig($extension);
  try {
    $this->featuresManager
      ->assignConfigPackage($machine_name, $config);
  } catch (\Exception $exception) {
    \Drupal::logger('features')
      ->error($exception
      ->getMessage());
  }
}