You are here

public function Index::getFieldRenames in Search API 8

Retrieves all field IDs that changed compared to the index's saved version.

Return value

string[] An associative array mapping old field IDs to the new ones.

Overrides IndexInterface::getFieldRenames

File

src/Entity/Index.php, line 811

Class

Index
Defines the search index configuration entity.

Namespace

Drupal\search_api\Entity

Code

public function getFieldRenames() {
  $renames = [];
  foreach ($this
    ->getFields() as $field_id => $field) {
    if ($field
      ->getOriginalFieldIdentifier() != $field_id) {
      $renames[$field
        ->getOriginalFieldIdentifier()] = $field_id;
    }
  }
  return $renames;
}