You are here

function colors_get_info in Colors 8

Get the config object.

Parameters

string $entity: The entity type

Return value

\Drupal\Core\Config\Config|null

3 calls to colors_get_info()
ColorsSettingsForm::getDefaultFormElements in src/Form/ColorsSettingsForm.php
Get form element for default settings.
ColorsSettingsForm::getFormElements in src/Form/ColorsSettingsForm.php
Get settings form elements.
colors_create_css in ./colors.module
Retrieves or generates a CSS with a given module's selector.

File

./colors.module, line 18
Controls assigning colors to entities.

Code

function colors_get_info($entity = NULL) {
  $config = NULL;
  if ($entity) {
    $config = \Drupal::configFactory()
      ->getEditable($entity);
  }
  $config = !$entity || !$config ? \Drupal::configFactory()
    ->getEditable('colors.settings') : $config;
  return $config;
}