You are here

public static function Utility::getConfigOverrides in Search API 8

Retrieves all overridden property values for the given config entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The config entity to check for overrides.

Return value

array An associative array mapping property names to their overridden values.

2 calls to Utility::getConfigOverrides()
Index::preSave in src/Entity/Index.php
Acts on an entity before the presave hook is invoked.
Server::preSave in src/Entity/Server.php
Acts on an entity before the presave hook is invoked.

File

src/Utility/Utility.php, line 165

Class

Utility
Contains utility methods for the Search API.

Namespace

Drupal\search_api\Utility

Code

public static function getConfigOverrides(EntityInterface $entity) {
  $entity_type = $entity
    ->getEntityType();
  if (!$entity_type instanceof ConfigEntityTypeInterface) {
    return [];
  }
  $config_key = $entity_type
    ->getConfigPrefix() . '.' . $entity
    ->id();
  $config = \Drupal::config($config_key);
  if (!$config
    ->hasOverrides()) {
    return [];
  }
  return static::collectOverrides($config, $config
    ->get());
}