You are here

function colors_get_enabled in Colors 8

Retrieves config entities.

Parameters

string $entity:

Return value

array

3 calls to colors_get_enabled()
ColorsSettingsForm::getFormElements in src/Form/ColorsSettingsForm.php
Get settings form elements.
colors_colors_palette in ./colors.module
Implements hook_colors_palette().
colors_get_class_names in ./colors.module
Retrieves class names for an entity.

File

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

Code

function colors_get_enabled($entity) {
  $configs = [];
  foreach (\Drupal::configFactory()
    ->listAll("colors.{$entity}") as $key) {
    $config = \Drupal::configFactory()
      ->getEditable($key);
    if ($config
      ->get('enabled')) {
      $configs[$key] = $config;
    }
  }
  return $configs;
}