You are here

public function ConfigManagerService::getMergedOptionsWithOverrides in Layout Builder Base 8

Function get the options merged with the possible overrides in the config.

Parameters

array $options: The default options.

string $property: The property associated to the options.

Return value

array The merged options that will be displayed in the interface.

File

src/ConfigManagerService.php, line 68

Class

ConfigManagerService
Class ConfigManagerService.

Namespace

Drupal\layout_builder_base

Code

public function getMergedOptionsWithOverrides(array $options, $property) {
  $override_options = $this
    ->getOverrideOptionsFromPropertyName($property);

  // If the reserved value none value is used, just return no options in
  // order to hide the interface.
  if (in_array('<none>', $override_options)) {
    $options = [];
  }
  else {
    $options = !empty($override_options) ? $override_options : $options;
  }
  return $options;
}