You are here

private function TeamAppFormTrait::getConfigObject in Apigee Edge 8

Returns a config object.

Parameters

string $config: Config object name.

Return value

\Drupal\Core\Config\ImmutableConfig The config object.

File

modules/apigee_edge_teams/src/Entity/Form/TeamAppFormTrait.php, line 152

Class

TeamAppFormTrait
Helper trait that contains team app (create/edit) form specific tweaks.

Namespace

Drupal\apigee_edge_teams\Entity\Form

Code

private function getConfigObject(string $config) : ImmutableConfig {

  /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
  $config_factory = \Drupal::service('config.factory');
  if (method_exists($this, 'configFactory') && $this
    ->configFactory() instanceof ConfigFactoryInterface) {
    $config_factory = $this
      ->configFactory();
  }
  elseif (property_exists($this, 'configFactory') && $this->configFactory instanceof ConfigFactoryInterface) {
    $config_factory = $this->configFactory;
  }
  return $config_factory
    ->get($config);
}