You are here

public function UnsavedIndexConfiguration::removeField in Search API 8

Removes a field from the index.

If the field doesn't exist, the call will fail silently.

Parameters

string $field_id: The ID of the field to remove.

Return value

$this

Throws

\Drupal\search_api\SearchApiException Thrown if the field is locked.

Overrides IndexInterface::removeField

File

src/UnsavedIndexConfiguration.php, line 461

Class

UnsavedIndexConfiguration
Represents a configuration of an index that was not yet permanently saved.

Namespace

Drupal\search_api

Code

public function removeField($field_id) {
  $this->entity
    ->removeField($field_id);
  return $this;
}